Skip to content

Make exceptions.pyi import its definitions from __builtin__.pyi #1610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 47 additions & 78 deletions stdlib/2/exceptions.pyi
Original file line number Diff line number Diff line change
@@ -1,80 +1,49 @@
from typing import Any, Tuple, Optional
from __builtin__ import ArithmeticError
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be ArithmeticError as ArithmeticError so that the name is re-exported from this module.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that's the test failure was about. I'll send another pull request.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from __builtin__ import AssertionError
from __builtin__ import AttributeError
from __builtin__ import BaseException
from __builtin__ import BufferError
from __builtin__ import BytesWarning
from __builtin__ import DeprecationWarning
from __builtin__ import EOFError
from __builtin__ import EnvironmentError
from __builtin__ import Exception
from __builtin__ import FloatingPointError
from __builtin__ import FutureWarning
from __builtin__ import GeneratorExit
from __builtin__ import IOError
from __builtin__ import ImportError
from __builtin__ import ImportWarning
from __builtin__ import IndentationError
from __builtin__ import IndexError
from __builtin__ import KeyError
from __builtin__ import KeyboardInterrupt
from __builtin__ import LookupError
from __builtin__ import MemoryError
from __builtin__ import NameError
from __builtin__ import NotImplementedError
from __builtin__ import OSError
from __builtin__ import OverflowError
from __builtin__ import PendingDeprecationWarning
from __builtin__ import RuntimeError
from __builtin__ import RuntimeWarning
from __builtin__ import StandardError
from __builtin__ import StopIteration
from __builtin__ import SyntaxError
from __builtin__ import SyntaxWarning
from __builtin__ import SystemError
from __builtin__ import SystemExit
from __builtin__ import TabError
from __builtin__ import TypeError
from __builtin__ import UnboundLocalError
from __builtin__ import UnicodeError
from __builtin__ import UnicodeDecodeError
from __builtin__ import UnicodeEncodeError
from __builtin__ import UnicodeTranslateError
from __builtin__ import UnicodeWarning
from __builtin__ import UserWarning
from __builtin__ import ValueError
from __builtin__ import Warning
from __builtin__ import ZeroDivisionError

class StandardError(Exception): ...
class ArithmeticError(StandardError): ...
class AssertionError(StandardError): ...
class AttributeError(StandardError): ...
class BaseException(object):
args = ... # type: Tuple[Any, ...]
message = ... # type: str
def __getslice__(self, start, end) -> Any: ...
def __getitem__(self, start, end) -> Any: ...
def __unicode__(self) -> unicode: ...
class BufferError(StandardError): ...
class BytesWarning(Warning): ...
class DeprecationWarning(Warning): ...
class EOFError(StandardError): ...
class EnvironmentError(StandardError):
errno = ... # type: int
strerror = ... # type: str
filename = ... # type: str
class Exception(BaseException): ...
class FloatingPointError(ArithmeticError): ...
class FutureWarning(Warning): ...
class GeneratorExit(BaseException): ...
class IOError(EnvironmentError): ...
class ImportError(StandardError): ...
class ImportWarning(Warning): ...
class IndentationError(SyntaxError): ...
class IndexError(LookupError): ...
class KeyError(LookupError): ...
class KeyboardInterrupt(BaseException): ...
class LookupError(StandardError): ...
class MemoryError(StandardError): ...
class NameError(StandardError): ...
class NotImplementedError(RuntimeError): ...
class OSError(EnvironmentError): ...
class OverflowError(ArithmeticError): ...
class PendingDeprecationWarning(Warning): ...
class ReferenceError(StandardError): ...
class RuntimeError(StandardError): ...
class RuntimeWarning(Warning): ...
class StopIteration(Exception): ...
class SyntaxError(StandardError):
text = ... # type: str
print_file_and_line = ... # type: Optional[str]
filename = ... # type: str
lineno = ... # type: int
offset = ... # type: int
msg = ... # type: str
class SyntaxWarning(Warning): ...
class SystemError(StandardError): ...
class SystemExit(BaseException):
code = ... # type: int
class TabError(IndentationError): ...
class TypeError(StandardError): ...
class UnboundLocalError(NameError): ...
class UnicodeError(ValueError): ...
class UnicodeDecodeError(UnicodeError):
start = ... # type: int
reason = ... # type: str
object = ... # type: str
end = ... # type: int
encoding = ... # type: str
class UnicodeEncodeError(UnicodeError):
start = ... # type: int
reason = ... # type: str
object = ... # type: unicode
end = ... # type: int
encoding = ... # type: str
class UnicodeTranslateError(UnicodeError):
start = ... # type: int
reason = ... # type: str
object = ... # type: Any
end = ... # type: int
encoding = ... # type: str
class UnicodeWarning(Warning): ...
class UserWarning(Warning): ...
class ValueError(StandardError): ...
class Warning(Exception): ...
class ZeroDivisionError(ArithmeticError): ...