Merge pull request #6595 from blueyed/fix-typing-code-path

typing: fix Code.path
This commit is contained in:
Ronny Pfannschmidt 2020-01-28 11:23:49 +01:00 committed by GitHub
commit c854daa234
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -77,12 +77,11 @@ class Code:
# maybe don't try this checking
if not p.check():
raise OSError("py.path check failed.")
return p
except OSError:
# XXX maybe try harder like the weird logic
# in the standard lib [linecache.updatecache] does?
p = self.raw.co_filename
return p
return self.raw.co_filename
@property
def fullsource(self) -> Optional["Source"]: