mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
SyntaxError's filename and lineno may be undefined. (#3918)
The Python source (Objects/exceptions.c) explicitly checks for null pointers before using the filename and lineno members. Some libraries, e.g. pkg_resources, set filename and lineno to undefined values if indeed none are appropriate.
This commit is contained in:
@@ -1570,10 +1570,10 @@ if sys.version_info >= (3, 5):
|
||||
value: Any
|
||||
class SyntaxError(_StandardError):
|
||||
msg: str
|
||||
lineno: int
|
||||
lineno: Optional[int]
|
||||
offset: Optional[int]
|
||||
text: Optional[str]
|
||||
filename: str
|
||||
filename: Optional[str]
|
||||
class SystemError(_StandardError): ...
|
||||
class TypeError(_StandardError): ...
|
||||
class ValueError(_StandardError): ...
|
||||
|
||||
@@ -1570,10 +1570,10 @@ if sys.version_info >= (3, 5):
|
||||
value: Any
|
||||
class SyntaxError(_StandardError):
|
||||
msg: str
|
||||
lineno: int
|
||||
lineno: Optional[int]
|
||||
offset: Optional[int]
|
||||
text: Optional[str]
|
||||
filename: str
|
||||
filename: Optional[str]
|
||||
class SystemError(_StandardError): ...
|
||||
class TypeError(_StandardError): ...
|
||||
class ValueError(_StandardError): ...
|
||||
|
||||
Reference in New Issue
Block a user