Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fefbbe5

Browse files
committed
fix bogus hasttr usage
1 parent 2e0d2dd commit fefbbe5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/copy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _copy_inst(x):
115115
state = x.__getstate__()
116116
else:
117117
state = x.__dict__
118-
if y.hasattr('__setstate__'):
118+
if hasattr(y, '__setstate__'):
119119
y.__setstate__(state)
120120
else:
121121
for key in state.keys():
@@ -209,7 +209,7 @@ def _deepcopy_inst(x, memo):
209209
else:
210210
state = x.__dict__
211211
state = deepcopy(state, memo)
212-
if y.hasattr('__setstate__'):
212+
if hasattr(y, '__setstate__'):
213213
y.__setstate__(state)
214214
else:
215215
for key in state.keys():

0 commit comments

Comments
 (0)