[Python-checkins] cpython (2.7): Make catched exceptions more specific and correct a comment.

serhiy.storchaka python-checkins at python.org
Wed Dec 30 14:00:58 EST 2015


https://hg.python.org/cpython/rev/32806d3f9bd2
changeset:   99723:32806d3f9bd2
branch:      2.7
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Wed Dec 30 20:59:32 2015 +0200
summary:
  Make catched exceptions more specific and correct a comment.

files:
  Lib/test/pickletester.py |  7 ++++---
  1 files changed, 4 insertions(+), 3 deletions(-)


diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -1373,15 +1373,16 @@
                 # 5th item is not an iterator
                 return dict, (), None, None, []
 
-        # Protocol 0 is less strict and also accept iterables.
+        # Protocol 0 in Python implementation is less strict and also accepts
+        # iterables.
         for proto in protocols:
             try:
                 self.dumps(C(), proto)
-            except (AttributeError, pickle.PickleError, cPickle.PickleError):
+            except (AttributeError, pickle.PicklingError, cPickle.PicklingError):
                 pass
             try:
                 self.dumps(D(), proto)
-            except (AttributeError, pickle.PickleError, cPickle.PickleError):
+            except (AttributeError, pickle.PicklingError, cPickle.PicklingError):
                 pass
 
     def test_many_puts_and_gets(self):

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list