summaryrefslogtreecommitdiffstats
path: root/Lib/typing.py
diff options
context:
space:
mode:
authorIvan Levkivskyi <levkivskyi@gmail.com>2018-05-11 03:10:10 (GMT)
committerGitHub <noreply@github.com>2018-05-11 03:10:10 (GMT)
commitb551e9f0ff25018a5606465003e2c51c04f693a3 (patch)
treed3eb5c2df42b1b3f58b843f00d7ec7f49924b8e6 /Lib/typing.py
parentdf00f048250b9a07195b0e3b1c5c0161fdcc9db8 (diff)
downloadcpython-b551e9f0ff25018a5606465003e2c51c04f693a3.zip
cpython-b551e9f0ff25018a5606465003e2c51c04f693a3.tar.gz
cpython-b551e9f0ff25018a5606465003e2c51c04f693a3.tar.bz2
Fix a bug in Generic.__new__ (GH-6758)
Diffstat (limited to 'Lib/typing.py')
-rw-r--r--Lib/typing.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index 89b73db..8025dfd 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -836,7 +836,7 @@ class Generic:
if cls is Generic:
raise TypeError("Type Generic cannot be instantiated; "
"it can be used only as a base class")
- if super().__new__ is object.__new__:
+ if super().__new__ is object.__new__ and cls.__init__ is not object.__init__:
obj = super().__new__(cls)
else:
obj = super().__new__(cls, *args, **kwds)