(fname)
| 547 | |
| 548 | |
| 549 | def _path_from_fname(fname) -> Path | None: |
| 550 | if not isinstance(fname, Path): |
| 551 | if isinstance(fname, str): |
| 552 | fname = Path(fname) |
| 553 | else: |
| 554 | # Try to get a filename from the file-like object |
| 555 | try: |
| 556 | fname = Path(fname.name) |
| 557 | except Exception: |
| 558 | fname = None |
| 559 | return fname |
no outgoing calls
no test coverage detected