Skip to content

Commit

Permalink
Two more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Levkivskyi committed Feb 17, 2018
1 parent 4146588 commit c133605
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions Lib/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def setx(self, value): ...
_reset_registry, _reset_caches)
except ImportError:
from _py_abc import ABCMeta, get_cache_token
ABCMeta.__module__ = 'abc'
else:
class ABCMeta(type):
"""Metaclass for defining Abstract Base Classes (ABCs).
Expand Down
5 changes: 4 additions & 1 deletion Modules/_abc.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,10 @@ _abc__abc_subclasscheck_impl(PyObject *module, PyObject *self,
goto end;
}
for (pos = 0; pos < PyList_GET_SIZE(subclasses); pos++) {
int r = PyObject_IsSubclass(subclass, PyList_GET_ITEM(subclasses, pos));
PyObject *scls = PyList_GET_ITEM(subclasses, pos);
Py_INCREF(scls);
int r = PyObject_IsSubclass(subclass, scls);
Py_DECREF(scls);
if (r > 0) {
if (_add_to_weak_set(&impl->_abc_cache, subclass) < 0) {
goto end;
Expand Down

0 comments on commit c133605

Please sign in to comment.