##// END OF EJS Templates
Fix Integer() wrapper transformer, thanks to @asmeurer
Thomas Kluyver -
Show More
@@ -486,6 +486,7 b' class IntegerWrapper(ast.NodeTransformer):'
486 if isinstance(node.n, int):
486 if isinstance(node.n, int):
487 return ast.Call(func=ast.Name(id='Integer', ctx=ast.Load()),
487 return ast.Call(func=ast.Name(id='Integer', ctx=ast.Load()),
488 args=[node], keywords=[])
488 args=[node], keywords=[])
489 return node
489
490
490 class TestAstTransform2(unittest.TestCase):
491 class TestAstTransform2(unittest.TestCase):
491 def setUp(self):
492 def setUp(self):
@@ -506,6 +507,10 b' class TestAstTransform2(unittest.TestCase):'
506 ip.run_cell("n = 2")
507 ip.run_cell("n = 2")
507 self.assertEqual(self.calls, [(2,)])
508 self.assertEqual(self.calls, [(2,)])
508
509
510 # This shouldn't throw an error
511 ip.run_cell("o = 2.0")
512 self.assertEqual(ip.user_ns['o'], 2.0)
513
509 def test_timeit(self):
514 def test_timeit(self):
510 called = set()
515 called = set()
511 def f(x):
516 def f(x):
General Comments 0
You need to be logged in to leave comments. Login now