Merge lp:~stefanor/ibid/float-maths into lp:~ibid-core/ibid/old-trunk-1.6

Proposed by Stefano Rivera
Status: Merged
Approved by: Jonathan Hitchcock
Approved revision: not available
Merged at revision: 837
Proposed branch: lp:~stefanor/ibid/float-maths
Merge into: lp:~ibid-core/ibid/old-trunk-1.6
Diff against target: 31 lines (+6/-2)
1 file modified
ibid/plugins/maths.py (+6/-2)
To merge this branch: bzr merge lp:~stefanor/ibid/float-maths
Reviewer Review Type Date Requested Status
Jonathan Hitchcock Approve
Michael Gorven Approve
Review via email: mp+17217@code.launchpad.net

This proposal supersedes a proposal from 2010-01-12.

To post a comment you must log in.
Revision history for this message
Jonathan Hitchcock (vhata) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Michael Gorven (mgorven) wrote :

 review approve

review: Approve
Revision history for this message
Jonathan Hitchcock (vhata) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ibid/plugins/maths.py'
--- ibid/plugins/maths.py 2010-01-11 22:49:21 +0000
+++ ibid/plugins/maths.py 2010-01-12 10:58:12 +0000
@@ -1,4 +1,5 @@
1from __future__ import division1from __future__ import division
2
2import logging3import logging
3from os import kill4from os import kill
4import re5import re
@@ -18,9 +19,12 @@
1819
19except ImportError:20except ImportError:
20 from compiler import ast, pycodegen, parse, misc, walk21 from compiler import ast, pycodegen, parse, misc, walk
22 transform_method='compiler'
21 class NodeTransformer(object):23 class NodeTransformer(object):
22 pass24 pass
23 transform_method='compiler'25 # ExpressionCodeGenerator doesn't inherit __futures__ from calling module:
26 class FD_ExpressionCodeGenerator(pycodegen.ExpressionCodeGenerator):
27 futures = ('division',)
2428
25help = {}29help = {}
26log = logging.getLogger('maths')30log = logging.getLogger('maths')
@@ -161,7 +165,7 @@
161 else:165 else:
162 misc.set_filename('<string>', ast)166 misc.set_filename('<string>', ast)
163 walk(ast, PowSubstitutionWalker())167 walk(ast, PowSubstitutionWalker())
164 code = pycodegen.ExpressionCodeGenerator(ast).getCode()168 code = FD_ExpressionCodeGenerator(ast).getCode()
165169
166 result = eval(code, {'__builtins__': None}, self.safe)170 result = eval(code, {'__builtins__': None}, self.safe)
167171

Subscribers

People subscribed via source and target branches