Skip to content

Commit 7a479ac

Browse files
author
benjamin.peterson
committed
Merged revisions 65853-65854 via svnmerge from
svn+ssh://[email protected]/sandbox/trunk/2to3/lib2to3 ........ r65853 | benjamin.peterson | 2008-08-19 11:09:09 -0500 (Tue, 19 Aug 2008) | 1 line apply a patch for #3131. this solves the problem for the moment, but we should do some refactoring to get display logic out of RefactoringTool ........ r65854 | benjamin.peterson | 2008-08-19 11:37:38 -0500 (Tue, 19 Aug 2008) | 1 line another quick fix to get lib2to3 to work ........ git-svn-id: http://svn.python.org/projects/python/trunk@65855 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent f7d1abf commit 7a479ac

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

Lib/lib2to3/refactor.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,11 @@ def get_fixers(self):
172172
want a pre-order AST traversal, and post_order is the list that want
173173
post-order traversal.
174174
"""
175-
fixer_pkg = self.fixer_dir.replace(os.path.sep, ".")
176-
if os.path.altsep:
177-
fixer_pkg = fixer_pkg.replace(os.path.altsep, ".")
175+
if os.path.isabs(self.fixer_dir):
176+
fixer_pkg = os.path.relpath(self.fixer_dir, os.path.join(os.path.dirname(__file__), '..'))
177+
else:
178+
fixer_pkg = self.fixer_dir
179+
fixer_pkg = fixer_pkg.replace(os.path.sep, ".")
178180
pre_order_fixers = []
179181
post_order_fixers = []
180182
fix_names = self.options.fix

Tools/scripts/2to3

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env python
22
from lib2to3 import refactor
33
import sys
4+
import os
45

5-
sys.exit(refactor.main("lib2to3/fixes"))
6+
fixers = os.path.join(os.path.dirname(refactor.__file__), "fixes")
7+
sys.exit(refactor.main(fixers))

0 commit comments

Comments
 (0)