[Python-checkins] r66648 - in sandbox/trunk/2to3/lib2to3: main.py refactor.py

benjamin.peterson python-checkins at python.org
Sat Sep 27 21:02:13 CEST 2008


Author: benjamin.peterson
Date: Sat Sep 27 21:02:13 2008
New Revision: 66648
Log:
raise errors when 2to3 is used as a library
Modified:
 sandbox/trunk/2to3/lib2to3/main.py
 sandbox/trunk/2to3/lib2to3/refactor.py
Modified: sandbox/trunk/2to3/lib2to3/main.py
==============================================================================
--- sandbox/trunk/2to3/lib2to3/main.py	(original)
+++ sandbox/trunk/2to3/lib2to3/main.py	Sat Sep 27 21:02:13 2008
@@ -15,6 +15,10 @@
 Prints output to stdout.
 """
 
+ def log_error(self, msg, *args, **kwargs):
+ self.errors.append((msg, args, kwargs))
+ self.logger.error(msg, *args, **kwargs)
+
 def print_output(self, lines):
 for line in lines:
 print line
Modified: sandbox/trunk/2to3/lib2to3/refactor.py
==============================================================================
--- sandbox/trunk/2to3/lib2to3/refactor.py	(original)
+++ sandbox/trunk/2to3/lib2to3/refactor.py	Sat Sep 27 21:02:13 2008
@@ -172,8 +172,7 @@
 
 def log_error(self, msg, *args, **kwds):
 """Increments error count and log a message."""
- self.errors.append((msg, args, kwds))
- self.logger.error(msg, *args, **kwds)
+ raise
 
 def log_message(self, msg, *args):
 """Hook to log a message."""


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /