summaryrefslogtreecommitdiff
path: root/astroid/builder.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2018-06-01 17:01:19 +0800
committerClaudiu Popa <pcmanticore@gmail.com>2018-06-01 17:01:19 +0800
commit9a13833bc81e2f56a091b19547afa3ffe5e6a1df (patch)
tree11dfc796830e7eaeaf0868938bf8b044d11593ab /astroid/builder.py
parent3091a210297e6651f6fd2f9fc9ff2c9dd6f071f5 (diff)
downloadastroid-git-9a13833bc81e2f56a091b19547afa3ffe5e6a1df.tar.gz
Bring back error as we use it for exposing it as a public API in pylint
Diffstat (limited to 'astroid/builder.py')
-rw-r--r--astroid/builder.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/astroid/builder.py b/astroid/builder.py
index 979d3fcc..433bd848 100644
--- a/astroid/builder.py
+++ b/astroid/builder.py
@@ -127,11 +127,11 @@ class AstroidBuilder(raw_building.InspectBuilder):
except IOError as exc:
raise exceptions.AstroidBuildingError(
'Unable to load file {path}:\n{error}',
- modname=modname, path=path) from exc
+ modname=modname, path=path, error=exc) from exc
except (SyntaxError, LookupError) as exc:
raise exceptions.AstroidSyntaxError(
'Python 3 encoding specification error or unknown encoding:\n'
- '{error}', modname=modname, path=path) from exc
+ '{error}', modname=modname, path=path, error=exc) from exc
except UnicodeError as exc: # wrong encoding
# detect_encoding returns utf-8 if no encoding specified
raise exceptions.AstroidBuildingError(
@@ -180,7 +180,7 @@ class AstroidBuilder(raw_building.InspectBuilder):
except (TypeError, ValueError, SyntaxError) as exc:
raise exceptions.AstroidSyntaxError(
'Parsing Python code failed:\n{error}',
- source=data, modname=modname, path=path) from exc
+ source=data, modname=modname, path=path, error=exc) from exc
if path is not None:
node_file = os.path.abspath(path)
else: