Commit 99a724e1 authored by Stefan Behnel's avatar Stefan Behnel

trunk merge

parents 7b52bdf6 bbfbddbc
...@@ -2986,15 +2986,16 @@ class ForInStatNode(LoopNode, StatNode): ...@@ -2986,15 +2986,16 @@ class ForInStatNode(LoopNode, StatNode):
else: else:
step = args[2] step = args[2]
if isinstance(step, ExprNodes.UnaryMinusNode) and isinstance(step.operand, ExprNodes.IntNode): if isinstance(step, ExprNodes.UnaryMinusNode) and isinstance(step.operand, ExprNodes.IntNode):
step = ExprNodes.IntNode(pos = step.pos, value=-int(step.operand.value)) step = ExprNodes.IntNode(pos = step.pos, value=str(-int(step.operand.value, 0)))
if isinstance(step, ExprNodes.IntNode): if isinstance(step, ExprNodes.IntNode):
if step.value > 0: step_value = int(step.value, 0)
if step_value > 0:
self.step = step self.step = step
self.relation1 = '<=' self.relation1 = '<='
self.relation2 = '<' self.relation2 = '<'
return True return True
elif step.value < 0: elif step_value < 0:
self.step = ExprNodes.IntNode(pos = step.pos, value=-int(step.value)) self.step = ExprNodes.IntNode(pos = step.pos, value=str(-step_value))
self.relation1 = '>=' self.relation1 = '>='
self.relation2 = '>' self.relation2 = '>'
return True return True
......
...@@ -55,6 +55,12 @@ class TestBuilder(object): ...@@ -55,6 +55,12 @@ class TestBuilder(object):
return suite return suite
def handle_directory(self, path, context): def handle_directory(self, path, context):
workdir = os.path.join(self.workdir, context)
if not os.path.exists(workdir):
os.makedirs(workdir)
if workdir not in sys.path:
sys.path.insert(0, workdir)
expect_errors = (context == 'errors') expect_errors = (context == 'errors')
suite = unittest.TestSuite() suite = unittest.TestSuite()
filenames = os.listdir(path) filenames = os.listdir(path)
...@@ -69,10 +75,10 @@ class TestBuilder(object): ...@@ -69,10 +75,10 @@ class TestBuilder(object):
continue continue
if context in TEST_RUN_DIRS: if context in TEST_RUN_DIRS:
test = CythonRunTestCase( test = CythonRunTestCase(
path, self.workdir, module, self.annotate) path, workdir, module, self.annotate)
else: else:
test = CythonCompileTestCase( test = CythonCompileTestCase(
path, self.workdir, module, expect_errors, self.annotate) path, workdir, module, expect_errors, self.annotate)
suite.addTest(test) suite.addTest(test)
return suite return suite
...@@ -242,9 +248,6 @@ if __name__ == '__main__': ...@@ -242,9 +248,6 @@ if __name__ == '__main__':
if not os.path.exists(WORKDIR): if not os.path.exists(WORKDIR):
os.makedirs(WORKDIR) os.makedirs(WORKDIR)
if not sys.path or sys.path[0] != WORKDIR:
sys.path.insert(0, WORKDIR)
if WITH_CYTHON: if WITH_CYTHON:
from Cython.Compiler.Version import version from Cython.Compiler.Version import version
from Cython.Compiler.Main import \ from Cython.Compiler.Main import \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment