closes #70381: IndendationError in import causes crash

authorSylvain Thénault <sylvain.thenault@logilab.fr>
changeset607f472c60d9
branchdefault
phasepublic
hiddenno
parent revision#99f77cc74cd5 closes #70497: Crash on AttributeError: 'NoneType' object has no attribute '_infer_name' by fixing constant factory
child revision#c8f6995834aa closes #70565: absolute imports treated as relative (patch by Jacek Konieczny)
files modified by this revision
ChangeLog
mixins.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1310120731 -7200
# Fri Jul 08 12:25:31 2011 +0200
# Node ID 607f472c60d9838fddc99687b63ef65b84e5e649
# Parent 99f77cc74cd5a8c9aaa890dd31f6de79d53e9643
closes #70381: IndendationError in import causes crash

diff --git a/ChangeLog b/ChangeLog
@@ -2,11 +2,12 @@
1  ================================
2 
3  --
4      * added column offset information on nodes (patch by fawce)
5      * #70497: Crash on AttributeError: 'NoneType' object has no attribute '_infer_name'
6 -	
7 +    * #70381: IndendationError in import causes crash
8 +
9  2011-01-11  --  0.21.1
10      * python3: handle file encoding; fix a lot of tests
11 
12      * fix #52006: "True" and "False" can be assigned as variable in Python2x
13 
diff --git a/mixins.py b/mixins.py
@@ -115,10 +115,12 @@
14              return mymodule
15          try:
16              return mymodule.import_module(modname, level=level)
17          except ASTNGBuildingException:
18              raise InferenceError(modname)
19 +        except SyntaxError, ex:
20 +            raise InferenceError(str(ex))
21 
22      def real_name(self, asname):
23          """get name from 'as' name"""
24          for name, _asname in self.names:
25              if name == '*':