summaryrefslogtreecommitdiff
path: root/astroid/exceptions.py
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright noticehippo912021-02-151-0/+1
|
* New copyright noticeshippo912020-12-271-1/+1
|
* Fix the new violations of super-without-argumentsClaudiu Popa2020-05-121-7/+7
|
* Initial formatting of astroidClaudiu Popa2018-10-021-10/+23
|
* Update the copyright noticesastroid-2.0Claudiu Popa2018-07-151-2/+4
|
* Allow google style docs to be built along side sphinx style docs, using ↵Claudiu Popa2018-06-041-3/+2
| | | | napoleon extension
* Fix inference tip collisionsBryce Guinta2018-02-061-0/+7
| | | | | Set predicates for transforms which use inference_tips to prevent a node's _explicit_inference from being overwritten
* Fix lint warningsClaudiu Popa2017-10-121-6/+0
|
* Let the type error propagate as an AstroidTypeError.Claudiu Popa2016-12-031-0/+8
|
* Remove pylint errorsDerek Gustafson2016-12-031-0/+6
|
* Even more granular copyrights (thanks to copyrite)Claudiu Popa2016-07-221-2/+5
|
* Keep a consistent copyright notice across the board.Claudiu Popa2016-07-191-0/+2
|
* Now is_subtype / is_supertype raises an internal exception when a type ↵Claudiu Popa2016-06-031-0/+4
| | | | | | | | hierarchy can't be determined It used to return Uninferable, but no call site was actually taking care of this potential return. It is better though to simply raise an exception and to let the call sites to handle them in which way they want to.
* Convert all files to new license headerCeridwen2016-05-161-17/+3
|
* Cleanup pylint's warnings over astroid codebaseClaudiu Popa2015-12-141-1/+2
| | | | | | | | | | Some of the messages were disabled in pylintrc, since they're not very useful for our case. Other parameters, such as the number of arguments / statements / attributes etc were configured so that they won't be too restrictive for our codebase, since making the code to respect them right now requires too much development changes, which is not justified by the end result. Closes issue #284.
* relative_to_absolute_name will now raise TooManyLevelsError when a relative ↵Claudiu Popa2015-12-061-0/+15
| | | | import is trying to access something beyond the top-level package.
* AstroidBuildingException is now AstroidBuildingError.Claudiu Popa2015-12-061-4/+5
| | | | The first name will exist until astroid 2.0.
* Add two new exceptions, AstroidImportError and AstroidSyntaxError.Claudiu Popa2015-12-061-0/+10
| | | | | | | | They are subclasses of AstroidBuildingException and are raised when a module can't be imported from various reasons. Also do_import_module lets the errors to bubble up without converting them to InferenceError. This particular conversion happens only during the inference.
* Merge upstream changesCeridwen2015-11-061-3/+3
|\
* | Add structured exceptions to decorators and remaining functions.Ceridwen2015-11-061-12/+0
| | | | | | | | | | | | | | | | | | | | * Use explicit StopIteration to pass information from generators to raise_if_nothing_inferred and path_wrapper, rather than return or implicit termination by reaching the end of the code block. * Remove remove_nodes in favor of handling the cases in local_attr, istance_attr, and getattr, to avoid the need for complicated information passing when needing to raise an exception.
* | This bookmark adds structured exceptions to astroid.Ceridwen2015-11-021-45/+133
|/ | | | | | | | | | | | | | | | | | | Major changes: * AstroidError has an __init__ that accepts arbitrary keyword-only arguments for adding information to exceptions, and a __str__ that lazily uses exception attributes to generate a message. The first positional argument to an exception is assigned to .message. The new API should be fully backwards compatible in general. * Some exceptions are combined or renamed; the old names are still available. * The OperationErrors used by pylint are now BadOperationMessages and located in util.py. * The AstroidBuildingException in _data_build stores the SyntaxError in its .error attribute rather than args[0]. * Many places where exceptions are raised have new, hopefully more useful error messages. The only major issue remaining is how to propagate information into decorators.
* Remove doctype and future imports which aren't useful.Claudiu Popa2015-10-111-2/+0
|
* Add support for retrieving TypeErrors for binary arithmetic operations and ↵Claudiu Popa2015-06-281-0/+13
| | | | | | | | | augmented assignments. The change is similar to what was added for UnaryOps: a new method called *type_errors* for both AugAssign and BinOp, which can be used to retrieve type errors occurred during inference. Also, a new exception object was added, BinaryOperationError.
* Use the name of the operand for UnaryOperationError.__str__.Claudiu Popa2015-06-131-1/+1
|
* Make the first steps towards detecting type errors for unary and binary ↵Claudiu Popa2015-06-111-0/+21
| | | | | | | | | | | | operations. In exceptions, one object was added for holding information about a possible UnaryOp TypeError, object called `UnaryOperationError`. Even though the name suggests it's an exception, it's actually not one. When inferring UnaryOps, we use this special object to mark a possible TypeError, object which can be interpreted by pylint in order to emit a new warning. We are also exposing a new method for UnaryOps, called `type_errors`, which returns a list of UnaryOperationsError.
* Add a new SuperError exception subclass, SuperArgumentTypeError, which is ↵Claudiu Popa2015-05-291-0/+4
| | | | raised when there's a problem with any argument of the super call (invalid types).
* Add a new *inference object* called SuperClaudiu Popa2015-05-281-0/+4
| | | | | | | | | | | | This patch also adds support for understanding super calls. astroid understands the zero-argument form of super, specific to Python 3, where the interpreter fills itself the arguments of the call. Also, we are understanding the 2-argument form of super, both for bounded lookups (super(X, instance)) as well as for unbounded lookups (super(X, Y)), having as well support for validating that the object-or-type is a subtype of the first argument. The unbounded form of super (one argument) is not understood, since it's useless in practice and should be removed from Python's specification. Closes issue #89.
* Add two new exceptions for handling MRO error cases.Claudiu Popa2015-05-031-0/+12
| | | | | | | DuplicateBasesError is emitted when duplicate bases are found in a class, InconsistentMroError is raised when the method resolution is determined to be inconsistent. They share a common class, MroError, which is a subclass of ResolveError, meaning that this change is backwards compatible.
* Move all astroid modules into a its own directory, which is now the package.Torsten Marek2014-11-081-0/+51
python setup.py develop now works.