Skip to content

Commit e939d08

Browse files
committed
del enclose_lookup_special; fix 'inspect' not found
1 parent c521b76 commit e939d08

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
try:
1111
from _types import *
1212
except ImportError:
13-
import inspect
1413
import sys
1514

1615
def _f(): pass
@@ -90,6 +89,7 @@ def lookup_special(object, name, default=_sentinel):
9089
`name` must be a string. If the named special attribute does not exist,
9190
`default` is returned if provided, otherwise AttributeError is raised.
9291
"""
92+
import inspect
9393

9494
cls = type(object)
9595
if not isinstance(name, str):
@@ -99,7 +99,7 @@ def lookup_special(object, name, default=_sentinel):
9999
try:
100100
descr = inspect.getattr_static(cls, name)
101101
except AttributeError:
102-
if not default is _sentinel:
102+
if default is not _sentinel:
103103
return default
104104
raise
105105
if hasattr(descr, "__get__"):
@@ -110,7 +110,7 @@ def lookup_special(object, name, default=_sentinel):
110110

111111
lookup_special = enclose_lookup_special()
112112

113-
del sys, inspect, _f, _g, _C, _c, _ag, _cell_factory # Not for export
113+
del sys, enclose_lookup_special, _f, _g, _C, _c, _ag, _cell_factory # Not for export
114114

115115

116116
# Provide a PEP 3115 compliant mechanism for class creation

0 commit comments

Comments
 (0)