This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tomspur
Recipients tomspur
Date 2010-02-05.19:37:30
SpamBayes Score 1.7767901e-06
Marked as misclassified No
Message-id <1265398652.17.0.813820450189.issue7861@psf.upfronthosting.co.za>
In-reply-to
Content
My custom setup / testcase for testing the transition "import foo" -> "from . import foo":

mkdir -p test/sub
touch test/sub/__init__.py
touch test/__init__.py

cat >> test/__init__.py << EOF
import sub
EOF

cat >> test.py << EOF
import test
EOF

This won't work with python3 so I ran 2to3 on it:
$ 2to3 .
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
RefactoringTool: No files need to be modified.

-> Nothing found.

Using the python3 version of 2to3:
$ python3-2to3 .
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
RefactoringTool: Refactored ./test/__init__.py
--- ./test/__init__.py (original)
+++ ./test/__init__.py (refactored)
@@ -1,1 +1,1 @@
-import sub
+from . import sub
RefactoringTool: Files that need to be modified:
RefactoringTool: ./test/__init__.py


-> python3 version of 2to3 can change it, but Python 2.6.2 is not able to.
History
Date User Action Args
2010-02-05 19:37:32tomspursetrecipients: + tomspur
2010-02-05 19:37:32tomspursetmessageid: <1265398652.17.0.813820450189.issue7861@psf.upfronthosting.co.za>
2010-02-05 19:37:30tomspurlinkissue7861 messages
2010-02-05 19:37:30tomspurcreate