Return a path object pointing to source code, or an ``str`` in case of ``OSError`` / non-existing file.
(self)
| 85 | |
| 86 | @property |
| 87 | def path(self) -> Union[Path, str]: |
| 88 | """Return a path object pointing to source code, or an ``str`` in |
| 89 | case of ``OSError`` / non-existing file.""" |
| 90 | if not self.raw.co_filename: |
| 91 | return "" |
| 92 | try: |
| 93 | p = absolutepath(self.raw.co_filename) |
| 94 | # maybe don't try this checking |
| 95 | if not p.exists(): |
| 96 | raise OSError("path check failed.") |
| 97 | return p |
| 98 | except OSError: |
| 99 | # XXX maybe try harder like the weird logic |
| 100 | # in the standard lib [linecache.updatecache] does? |
| 101 | return self.raw.co_filename |
| 102 | |
| 103 | @property |
| 104 | def fullsource(self) -> Optional["Source"]: |
nothing calls this directly
no test coverage detected