Change wrapper logic for testing
This commit is contained in:
parent
f0ba70cda4
commit
77668e1d65
1 changed files with 3 additions and 4 deletions
|
|
@ -83,10 +83,9 @@ def fix_standard_imports(red):
|
||||||
return red
|
return red
|
||||||
|
|
||||||
|
|
||||||
def fix(input_file):
|
def fix(ast):
|
||||||
ast = read_source(input_file)
|
"""Wrapper which allows for testing when not running from shell"""
|
||||||
new_ast = fix_imports(ast)
|
return fix_imports(ast).dumps()
|
||||||
write_source(new_ast, input_file)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
input_file = sys.argv[1]
|
input_file = sys.argv[1]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue