diff --git a/evaluate.py b/evaluate.py index 8189de9d..5ad23ca6 100644 --- a/evaluate.py +++ b/evaluate.py @@ -75,7 +75,8 @@ def clear_caches(): for m in memoize_caches: m.clear() - memoize_caches = [] + # memorize_caches must never be deleted, because the dicts will get lost in + # the wrappers. statement_path = [] faked_scopes = [] diff --git a/functions.py b/functions.py index cedaa3c1..98cf7c60 100644 --- a/functions.py +++ b/functions.py @@ -70,6 +70,7 @@ class Definition(object): def __init__(self, definition): """ The definition of a function """ self.definition = definition + self._def_parent = self.definition.parent() # just here to limit gc par = self.definition while True: @@ -319,15 +320,3 @@ def set_debug_function(func_cb): def _clear_caches(): evaluate.clear_caches() - return - import gc - #gc.set_debug(gc.DEBUG_STATS | gc.DEBUG_COLLECTABLE | gc.DEBUG_UNCOLLECTABLE | gc.DEBUG_OBJECTS) - #gc.collect() - count = 0 - for o in gc.get_objects(): - if isinstance(o, parsing.Module): - pass - count += 1 - #print o - print count - #exit() diff --git a/modules.py b/modules.py index 5eb5b4d4..5a439785 100644 --- a/modules.py +++ b/modules.py @@ -7,9 +7,6 @@ import parsing import builtin import debug -files = {} -load_module_cb = None - class Module(builtin.CachedModule): """ diff --git a/parsing.py b/parsing.py index f1d1f7f1..82c4258a 100644 --- a/parsing.py +++ b/parsing.py @@ -1334,7 +1334,6 @@ class PyFuzzyParser(object): """ buf = BytesIO(self.code) self.gen = tokenize_func(buf.readline) - self.currentscope = self.scope # TODO remove? extended_flow = ['else', 'elif', 'except', 'finally'] statement_toks = ['{', '[', '(', '`'] @@ -1346,8 +1345,6 @@ class PyFuzzyParser(object): token_type, tok = self.next() #debug.dbg('main: tok=[%s] type=[%s] indent=[%s]'\ # % (tok, token_type, start_position[0])) - #print('main: tok=[%s] type=[%s] indent=[%s]' - # % (tok, tokenize.tok_name[token_type], self.start_pos[0])) while token_type == tokenize.DEDENT \ and self.scope != self.module: diff --git a/test/completion/thirdparty/PySide_.py b/test/completion/thirdparty/PySide_.py deleted file mode 100644 index 69c37d82..00000000 --- a/test/completion/thirdparty/PySide_.py +++ /dev/null @@ -1,9 +0,0 @@ -from PySide import QtCore -from PySide import QtGui - -##? ['QEvent'] -QtCore.QEvent - -##? [] -QtGui.QButton - diff --git a/test/run.py b/test/run.py index 9242bdc1..d0545cb8 100755 --- a/test/run.py +++ b/test/run.py @@ -9,8 +9,8 @@ sys.path.append('.') import functions from _compatibility import unicode, BytesIO -only_line = int(sys.argv[2]) if len(sys.argv) > 2 else None -if only_line is not None: +only_line = [int(o) for o in sys.argv[2:]] +if only_line: import debug debug.debug_function = \ functions.debug.print_to_stdout @@ -164,7 +164,7 @@ def run_test(source, f_name): correct = None else: # reset the test, if only one specific test is wanted - if only_line and line_nr != only_line: + if only_line and line_nr not in only_line: correct = None return tests, fails @@ -209,5 +209,6 @@ print('\nSummary:') for s in summary: print(s) + exit_code = 0 if tests_pass else 1 sys.exit(exit_code)