Merge pull request #6526 from blueyed/typing-code-path
doc: fix Code.path: might return str
This commit is contained in:
commit
2f00b041e4
|
@ -68,8 +68,9 @@ class Code:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def path(self) -> Union[py.path.local, str]:
|
def path(self) -> Union[py.path.local, str]:
|
||||||
""" return a path object pointing to source code (note that it
|
""" return a path object pointing to source code (or a str in case
|
||||||
might not point to an actually existing file). """
|
of OSError / non-existing file).
|
||||||
|
"""
|
||||||
try:
|
try:
|
||||||
p = py.path.local(self.raw.co_filename)
|
p = py.path.local(self.raw.co_filename)
|
||||||
# maybe don't try this checking
|
# maybe don't try this checking
|
||||||
|
|
Loading…
Reference in New Issue