]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
fix bogus hasttr usage
authorGuido van Rossum <guido@python.org>
Wed, 22 Mar 1995 10:10:31 +0000 (10:10 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 22 Mar 1995 10:10:31 +0000 (10:10 +0000)
Lib/copy.py

index 3bbf3e7fafa5407d2adf6bf3a785bf79c62555b1..a48e8c8e3a97ebfaaffcbfa08902471692d736ed 100644 (file)
@@ -115,7 +115,7 @@ def _copy_inst(x):
                        state = x.__getstate__()
        else:
                        state = x.__dict__
-       if y.hasattr('__setstate__'):
+       if hasattr(y, '__setstate__'):
                        y.__setstate__(state)
        else:
                        for key in state.keys():
@@ -209,7 +209,7 @@ def _deepcopy_inst(x, memo):
        else:
                        state = x.__dict__
        state = deepcopy(state, memo)
-       if y.hasattr('__setstate__'):
+       if hasattr(y, '__setstate__'):
                        y.__setstate__(state)
        else:
                        for key in state.keys():