bpo-11572: Make minor improvements to copy module (GH-8208)

* When doing getattr lookups with a default of "None", it now
  uses an "is" comparison against None which is more correct
* Removed outdated code

Patch by Brandon Rhodes.
This commit is contained in:
Berker Peksag 2018-07-09 23:14:54 +03:00 committed by GitHub
parent 9863de0355
commit 2708578736
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 25 deletions

View file

@ -510,11 +510,7 @@ class _Pickler:
rv = reduce(obj)
else:
# Check for a class with a custom metaclass; treat as regular class
try:
issc = issubclass(t, type)
except TypeError: # t is not a class (old Boost; see SF #502085)
issc = False
if issc:
if issubclass(t, type):
self.save_global(obj)
return