From fa48604bac2b22dd06e9261ab2b2371569e46c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sylvain=20Th=C3=A9nault?= Date: Thu, 22 Feb 2007 13:11:45 +0100 Subject: fix chained import as bug --- inference.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'inference.py') diff --git a/inference.py b/inference.py index 9ec03485..68874550 100644 --- a/inference.py +++ b/inference.py @@ -345,10 +345,12 @@ def infer_from(self, context=None, asname=True): name = context.lookupname if name is None: raise InferenceError() - module = _imported_module_astng(self, self.modname) if asname: name = self.real_name(name) + module = _imported_module_astng(self, self.modname) try: + context = copy_context(context) + context.lookupname = name return _infer_stmts(module.getattr(name), context) except NotFoundError: raise InferenceError(name) -- cgit v1.2.1