Skip to content

Commit c4405e6

Browse files
committed
Bump the priority of fix_import
Guarantees it does its thing before any other fixer accidentally blocks its execution.
1 parent 01e4b58 commit c4405e6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

libmodernize/fixes/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
'lib2to3.fixes.fix_funcattrs',
99
'lib2to3.fixes.fix_has_key',
1010
'lib2to3.fixes.fix_idioms',
11-
'lib2to3.fixes.fix_import',
1211
'lib2to3.fixes.fix_methodattrs',
1312
'lib2to3.fixes.fix_ne',
1413
'lib2to3.fixes.fix_numliterals',

libmodernize/fixes/fix_import.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
class FixImport(fix_import.FixImport):
88

9+
# Make sure this runs before any other fixer to guarantee that any other
10+
# added absolute_import doesn't block this fixer's execution.
11+
run_order = 1
12+
913
def transform(self, node, results):
1014
results = super(FixImport, self).transform(node, results)
1115
if results is None:

0 commit comments

Comments
 (0)