fixed bug in recursion detection (not really a fix, I don't understand why this happens only in python3)

This commit is contained in:
David Halter
2012-10-14 02:18:17 +02:00
parent ad2aaa124b
commit 3a6d9ba955
3 changed files with 6 additions and 1 deletions

View File

@@ -36,7 +36,10 @@ class RecursionDecorator(object):
return False return False
def pop_stmt(self): def pop_stmt(self):
self.current = self.current.parent if self.current is not None:
# I don't know how current can be None, but sometimes it happens
# with Python3.
self.current = self.current.parent
def _check_recursion(self): def _check_recursion(self):
test = self.current test = self.current

View File

@@ -141,6 +141,7 @@ class ImportPath(object):
scope, rest = self._follow_file_system() scope, rest = self._follow_file_system()
except ModuleNotFound: except ModuleNotFound:
debug.warning('Module not found: ' + str(self.import_stmt)) debug.warning('Module not found: ' + str(self.import_stmt))
evaluate.follow_statement.pop_stmt()
return [] return []
scopes = [scope] scopes = [scope]

View File

@@ -10,6 +10,7 @@ sys.path.append('.')
from _compatibility import is_py25 from _compatibility import is_py25
import api import api
#api.set_debug_function(api.debug.print_to_stdout) #api.set_debug_function(api.debug.print_to_stdout)