[Python-checkins] r54320 - in sandbox/trunk/2to3: fixes/basefix.py pgen2/parse.py tests/test_pytree.py
neal.norwitz
python-checkins at python.org
Tue Mar 13 06:13:04 CET 2007
Author: neal.norwitz
Date: Tue Mar 13 06:12:59 2007
New Revision: 54320
Modified:
sandbox/trunk/2to3/fixes/basefix.py
sandbox/trunk/2to3/pgen2/parse.py
sandbox/trunk/2to3/tests/test_pytree.py
Log:
Tighten up the conditions a bit when checking for compatability
Modified: sandbox/trunk/2to3/fixes/basefix.py
==============================================================================
--- sandbox/trunk/2to3/fixes/basefix.py (original)
+++ sandbox/trunk/2to3/fixes/basefix.py Tue Mar 13 06:12:59 2007
@@ -9,8 +9,8 @@
# Get a usable 'set' constructor
try:
- set()
-except:
+ set
+except NameError:
from sets import Set as set
# Local imports
Modified: sandbox/trunk/2to3/pgen2/parse.py
==============================================================================
--- sandbox/trunk/2to3/pgen2/parse.py (original)
+++ sandbox/trunk/2to3/pgen2/parse.py Tue Mar 13 06:12:59 2007
@@ -12,8 +12,8 @@
# Get a usable 'set' constructor
try:
- set()
-except:
+ set
+except NameError:
from sets import Set as set
# Local imports
Modified: sandbox/trunk/2to3/tests/test_pytree.py
==============================================================================
--- sandbox/trunk/2to3/tests/test_pytree.py (original)
+++ sandbox/trunk/2to3/tests/test_pytree.py Tue Mar 13 06:12:59 2007
@@ -20,7 +20,7 @@
try:
sorted
-except:
+except NameError:
def sorted(lst):
l = list(lst)
l.sort()
More information about the Python-checkins
mailing list