[Python-checkins] r53463 - sandbox/trunk/2to3/fixes/basefix.py
guido.van.rossum
python-checkins at python.org
Wed Jan 17 05:43:25 CET 2007
Author: guido.van.rossum
Date: Wed Jan 17 05:43:24 2007
New Revision: 53463
Modified:
sandbox/trunk/2to3/fixes/basefix.py
Log:
Pre-populate the results dict in the match() method, so a pattern
without any variable assignments won't accidentally return False
even if matching (I've debugged this same trap at least twice now).
Modified: sandbox/trunk/2to3/fixes/basefix.py
==============================================================================
--- sandbox/trunk/2to3/fixes/basefix.py (original)
+++ sandbox/trunk/2to3/fixes/basefix.py Wed Jan 17 05:43:24 2007
@@ -68,7 +68,7 @@
Subclass may override.
"""
- results = {}
+ results = {"node": node}
return self.pattern.match(node, results) and results
def transform(self, node):
More information about the Python-checkins
mailing list