This commit is contained in:
David Halter
2012-09-06 11:23:12 +02:00
parent 61cb267dd5
commit 844e222ed5
6 changed files with 20 additions and 19 deletions

View File

@@ -93,6 +93,7 @@ else:
except AttributeError: except AttributeError:
return False return False
class Python3Method(object): class Python3Method(object):
def __init__(self, func): def __init__(self, func):
self.func = func self.func = func
@@ -109,6 +110,7 @@ try:
except ImportError: except ImportError:
reduce = reduce reduce = reduce
def use_metaclass(meta, *bases): def use_metaclass(meta, *bases):
""" Create a class with a metaclass. """ """ Create a class with a metaclass. """
if not bases: if not bases:
@@ -120,6 +122,7 @@ try:
except ImportError: except ImportError:
# python 2.5 doesn't have this method # python 2.5 doesn't have this method
import string import string
def cleandoc(doc): def cleandoc(doc):
"""Clean up indentation from docstrings. """Clean up indentation from docstrings.
@@ -141,7 +144,8 @@ except ImportError:
if lines: if lines:
lines[0] = lines[0].lstrip() lines[0] = lines[0].lstrip()
if margin < sys.maxint: if margin < sys.maxint:
for i in range(1, len(lines)): lines[i] = lines[i][margin:] for i in range(1, len(lines)):
lines[i] = lines[i][margin:]
# Remove any trailing or leading blank lines. # Remove any trailing or leading blank lines.
while lines and not lines[-1]: while lines and not lines[-1]:
lines.pop() lines.pop()

View File

@@ -1030,8 +1030,6 @@ def get_scopes_for_name(scope, name_str, position=None, search_global=False):
""" """
result = [] result = []
no_break_scope = False no_break_scope = False
#if isinstance(scope, InstanceElement) and scope.var == name.parent().parent():
#name = InstanceElement(scope.instance, name)
par = name.parent() par = name.parent()
if par.isinstance(parsing.Flow): if par.isinstance(parsing.Flow):

View File

@@ -92,7 +92,8 @@ class ExecutionRecursionDecorator(object):
self.reset() self.reset()
def __call__(self, execution, evaluate_generator=False): def __call__(self, execution, evaluate_generator=False):
#print execution, self.recursion_level, self.execution_count, len(self.execution_funcs), a debug.dbg('Execution recursions: ', execution, self.recursion_level,
self.execution_count, len(self.execution_funcs))
if self.check_recursion(execution, evaluate_generator): if self.check_recursion(execution, evaluate_generator):
result = [] result = []
else: else:

View File

@@ -30,7 +30,6 @@ class TestRegression(unittest.TestCase):
"A.different_line" "A.different_line"
) )
in_name = 2, 9 in_name = 2, 9
under_score = 2, 8 under_score = 2, 8
cls = 2, 7 cls = 2, 7

View File

@@ -7,7 +7,7 @@ import traceback
os.chdir(os.path.dirname(os.path.abspath(__file__)) + '/..') os.chdir(os.path.dirname(os.path.abspath(__file__)) + '/..')
sys.path.append('.') sys.path.append('.')
from _compatibility import unicode, BytesIO, reduce, literal_eval from _compatibility import unicode, BytesIO, reduce, literal_eval, is_py25
import functions import functions
import debug import debug
@@ -185,8 +185,7 @@ def test_dir(completion_test_dir, thirdparty=False):
if f_name.endswith(".py") and (not test_files or files_to_execute): if f_name.endswith(".py") and (not test_files or files_to_execute):
# for python2.5 certain tests are not being done, because it # for python2.5 certain tests are not being done, because it
# only has these features partially. # only has these features partially.
if sys.hexversion < 0x02060000 \ if is_py25 and f_name in ['generators.py', 'types.py']:
and f_name in ['generators.py', 'types.py']:
continue continue
if thirdparty: if thirdparty: