typing: fix Code.path
Fixes: > src/_pytest/_code/code.py:83: error: Incompatible types in assignment > (expression has type "str", variable has type "local") [assignment]
This commit is contained in:
parent
d0cb16010b
commit
12c5a6af64
|
@ -77,12 +77,11 @@ class Code:
|
||||||
# maybe don't try this checking
|
# maybe don't try this checking
|
||||||
if not p.check():
|
if not p.check():
|
||||||
raise OSError("py.path check failed.")
|
raise OSError("py.path check failed.")
|
||||||
|
return p
|
||||||
except OSError:
|
except OSError:
|
||||||
# XXX maybe try harder like the weird logic
|
# XXX maybe try harder like the weird logic
|
||||||
# in the standard lib [linecache.updatecache] does?
|
# in the standard lib [linecache.updatecache] does?
|
||||||
p = self.raw.co_filename
|
return self.raw.co_filename
|
||||||
|
|
||||||
return p
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def fullsource(self) -> Optional["Source"]:
|
def fullsource(self) -> Optional["Source"]:
|
||||||
|
|
Loading…
Reference in New Issue