]> granicus.if.org Git - python/commitdiff
Remove use of tuple unpacking and dict.has_key() so as to silence
authorBrett Cannon <bcannon@gmail.com>
Fri, 1 Aug 2008 01:36:47 +0000 (01:36 +0000)
committerBrett Cannon <bcannon@gmail.com>
Fri, 1 Aug 2008 01:36:47 +0000 (01:36 +0000)
SyntaxWarning as triggered by -3.

Lib/bdb.py
Lib/pdb.py

index 74870e3f5157f630d2ab3a1800203e02e0e8110e..d74415bf14771fd29777e7ece80654777d4552a6 100644 (file)
@@ -131,8 +131,7 @@ class Bdb:
         raise NotImplementedError, "subclass of bdb must implement do_clear()"
 
     def break_anywhere(self, frame):
-        return self.breaks.has_key(
-            self.canonic(frame.f_code.co_filename))
+        return self.canonic(frame.f_code.co_filename) in self.breaks
 
     # Derived classes should override the user_* methods
     # to gain control.
@@ -150,7 +149,8 @@ class Bdb:
         """This method is called when a return trap is set here."""
         pass
 
-    def user_exception(self, frame, (exc_type, exc_value, exc_traceback)):
+    def user_exception(self, frame, exc_info):
+        exc_type, exc_value, exc_traceback = exc_info
         """This method is called if an exception occurs,
         but only if we are to stop at or just below this level."""
         pass
index 86162025f847eb39abb62fe599cb4feab6160c22..a7a3a18befaf0d188949c0920dfb47c9c7810e7d 100755 (executable)
@@ -175,7 +175,8 @@ class Pdb(bdb.Bdb, cmd.Cmd):
         print >>self.stdout, '--Return--'
         self.interaction(frame, None)
 
-    def user_exception(self, frame, (exc_type, exc_value, exc_traceback)):
+    def user_exception(self, frame, exc_info):
+        exc_type, exc_value, exc_traceback = exc_info
         """This function is called if an exception occurs,
         but only if we are to stop at or just below this level."""
         frame.f_locals['__exception__'] = exc_type, exc_value