Skip to content

Commit 4ee470a

Browse files
committed
Issue #190: clean up unused libfuturize fixer FixOldstrWrap
1 parent 511359a commit 4ee470a

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

src/libfuturize/fixes/fix_oldstr_wrap.py

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -37,42 +37,3 @@ def transform(self, node, results):
3737
new.value = u'b' + new.value
3838
wrapped = wrap_in_fn_call("oldstr", [new], prefix=node.prefix)
3939
return wrapped
40-
41-
def transform(self, node, results):
42-
expr1, expr2 = results[0].clone(), results[1].clone()
43-
# Strip any leading space for the first number:
44-
expr1.prefix = u''
45-
return wrap_in_fn_call("old_div", expr1, expr2, prefix=node.prefix)
46-
47-
48-
class FixDivisionSafe(fixer_base.BaseFix):
49-
# BM_compatible = True
50-
run_order = 4 # this seems to be ignored?
51-
52-
_accept_type = token.SLASH
53-
54-
PATTERN = """
55-
term<(not('/') any)+ '/' ((not('/') any))>
56-
"""
57-
58-
def match(self, node):
59-
u"""
60-
Since the tree needs to be fixed once and only once if and only if it
61-
matches, then we can start discarding matches after we make the first.
62-
"""
63-
if (node.type == self.syms.term and
64-
len(node.children) == 3 and
65-
match_division(node.children[1])):
66-
expr1, expr2 = node.children[0], node.children[2]
67-
return expr1, expr2
68-
else:
69-
return False
70-
71-
def transform(self, node, results):
72-
future_import(u"division", node)
73-
touch_import_top(u'past.utils', u'old_div', node)
74-
expr1, expr2 = results[0].clone(), results[1].clone()
75-
# Strip any leading space for the first number:
76-
expr1.prefix = u''
77-
return wrap_in_fn_call("old_div", expr1, expr2, prefix=node.prefix)
78-

0 commit comments

Comments
 (0)