summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@gmail.com>2020-03-12 04:06:46 (GMT)
committerGitHub <noreply@github.com>2020-03-12 04:06:46 (GMT)
commit1dd3794b19cfec448e5a55d8d01efd6bdb5a1169 (patch)
tree74290ba892590452bd7e023f90dd0aef18ee56be /Modules
parentc00c86b90443dbf3534cc4786a0b42b58db6e8af (diff)
downloadcpython-1dd3794b19cfec448e5a55d8d01efd6bdb5a1169.zip
cpython-1dd3794b19cfec448e5a55d8d01efd6bdb5a1169.tar.gz
cpython-1dd3794b19cfec448e5a55d8d01efd6bdb5a1169.tar.bz2
Simplify defaultdict.__or__ (#18931)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_collectionsmodule.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index d0a381d..fd0e4ed 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -2133,12 +2133,8 @@ defdict_repr(defdictobject *dd)
static PyObject*
defdict_or(PyObject* left, PyObject* right)
{
- int left_is_self = PyObject_IsInstance(left, (PyObject*)&defdict_type);
- if (left_is_self < 0) {
- return NULL;
- }
PyObject *self, *other;
- if (left_is_self) {
+ if (PyObject_TypeCheck(left, &defdict_type)) {
self = left;
other = right;
}