Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
57b39e09
Commit
57b39e09
authored
Apr 11, 2007
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #1697782: remove all remaining code that uses types.InstanceType.
parent
b5ddcfd2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
10 additions
and
38 deletions
+10
-38
Lib/cgitb.py
Lib/cgitb.py
+7
-9
Lib/idlelib/ObjectBrowser.py
Lib/idlelib/ObjectBrowser.py
+0
-10
Lib/idlelib/rpc.py
Lib/idlelib/rpc.py
+0
-2
Lib/plat-mac/aetypes.py
Lib/plat-mac/aetypes.py
+1
-2
Lib/plat-mac/findertools.py
Lib/plat-mac/findertools.py
+2
-2
Lib/pydoc.py
Lib/pydoc.py
+0
-2
Lib/test/crashers/infinite_rec_5.py
Lib/test/crashers/infinite_rec_5.py
+0
-10
Lib/test/test_isinstance.py
Lib/test/test_isinstance.py
+0
-1
No files found.
Lib/cgitb.py
View file @
57b39e09
...
@@ -167,11 +167,10 @@ function calls leading up to the error, in the order they occurred.</p>'''
...
@@ -167,11 +167,10 @@ function calls leading up to the error, in the order they occurred.</p>'''
exception
=
[
'<p>%s: %s'
%
(
strong
(
pydoc
.
html
.
escape
(
str
(
etype
))),
exception
=
[
'<p>%s: %s'
%
(
strong
(
pydoc
.
html
.
escape
(
str
(
etype
))),
pydoc
.
html
.
escape
(
str
(
evalue
)))]
pydoc
.
html
.
escape
(
str
(
evalue
)))]
if
type
(
evalue
)
is
types
.
InstanceType
:
for
name
in
dir
(
evalue
):
for
name
in
dir
(
evalue
):
if
name
[:
1
]
==
'_'
:
continue
if
name
[:
1
]
==
'_'
:
continue
value
=
pydoc
.
html
.
repr
(
getattr
(
evalue
,
name
))
value
=
pydoc
.
html
.
repr
(
getattr
(
evalue
,
name
))
exception
.
append
(
'
\
n
<br>%s%s =
\
n
%s'
%
(
indent
,
name
,
value
))
exception
.
append
(
'
\
n
<br>%s%s =
\
n
%s'
%
(
indent
,
name
,
value
))
import
traceback
import
traceback
return
head
+
''
.
join
(
frames
)
+
''
.
join
(
exception
)
+
'''
return
head
+
''
.
join
(
frames
)
+
''
.
join
(
exception
)
+
'''
...
@@ -239,10 +238,9 @@ function calls leading up to the error, in the order they occurred.
...
@@ -239,10 +238,9 @@ function calls leading up to the error, in the order they occurred.
frames
.
append
(
'
\
n
%s
\
n
'
%
'
\
n
'
.
join
(
rows
))
frames
.
append
(
'
\
n
%s
\
n
'
%
'
\
n
'
.
join
(
rows
))
exception
=
[
'%s: %s'
%
(
str
(
etype
),
str
(
evalue
))]
exception
=
[
'%s: %s'
%
(
str
(
etype
),
str
(
evalue
))]
if
type
(
evalue
)
is
types
.
InstanceType
:
for
name
in
dir
(
evalue
):
for
name
in
dir
(
evalue
):
value
=
pydoc
.
text
.
repr
(
getattr
(
evalue
,
name
))
value
=
pydoc
.
text
.
repr
(
getattr
(
evalue
,
name
))
exception
.
append
(
'
\
n
%s%s = %s'
%
(
" "
*
4
,
name
,
value
))
exception
.
append
(
'
\
n
%s%s = %s'
%
(
" "
*
4
,
name
,
value
))
import
traceback
import
traceback
return
head
+
''
.
join
(
frames
)
+
''
.
join
(
exception
)
+
'''
return
head
+
''
.
join
(
frames
)
+
''
.
join
(
exception
)
+
'''
...
...
Lib/idlelib/ObjectBrowser.py
View file @
57b39e09
...
@@ -57,15 +57,6 @@ class ObjectTreeItem(TreeItem):
...
@@ -57,15 +57,6 @@ class ObjectTreeItem(TreeItem):
sublist
.
append
(
item
)
sublist
.
append
(
item
)
return
sublist
return
sublist
class
InstanceTreeItem
(
ObjectTreeItem
):
def
IsExpandable
(
self
):
return
True
def
GetSubList
(
self
):
sublist
=
ObjectTreeItem
.
GetSubList
(
self
)
sublist
.
insert
(
0
,
make_objecttreeitem
(
"__class__ ="
,
self
.
object
.
__class__
))
return
sublist
class
ClassTreeItem
(
ObjectTreeItem
):
class
ClassTreeItem
(
ObjectTreeItem
):
def
IsExpandable
(
self
):
def
IsExpandable
(
self
):
return
True
return
True
...
@@ -120,7 +111,6 @@ dispatch = {
...
@@ -120,7 +111,6 @@ dispatch = {
TupleType
:
SequenceTreeItem
,
TupleType
:
SequenceTreeItem
,
ListType
:
SequenceTreeItem
,
ListType
:
SequenceTreeItem
,
DictType
:
DictTreeItem
,
DictType
:
DictTreeItem
,
InstanceType
:
InstanceTreeItem
,
ClassType
:
ClassTreeItem
,
ClassType
:
ClassTreeItem
,
}
}
...
...
Lib/idlelib/rpc.py
View file @
57b39e09
...
@@ -574,8 +574,6 @@ def _getmethods(obj, methods):
...
@@ -574,8 +574,6 @@ def _getmethods(obj, methods):
attr
=
getattr
(
obj
,
name
)
attr
=
getattr
(
obj
,
name
)
if
callable
(
attr
):
if
callable
(
attr
):
methods
[
name
]
=
1
methods
[
name
]
=
1
if
type
(
obj
)
==
types
.
InstanceType
:
_getmethods
(
obj
.
__class__
,
methods
)
if
type
(
obj
)
==
types
.
ClassType
:
if
type
(
obj
)
==
types
.
ClassType
:
for
super
in
obj
.
__bases__
:
for
super
in
obj
.
__bases__
:
_getmethods
(
super
,
methods
)
_getmethods
(
super
,
methods
)
...
...
Lib/plat-mac/aetypes.py
View file @
57b39e09
...
@@ -518,8 +518,7 @@ class ComponentItem(SelectableItem):
...
@@ -518,8 +518,7 @@ class ComponentItem(SelectableItem):
ss
=
repr
(
seld
)
ss
=
repr
(
seld
)
elif
IsRange
(
seld
):
elif
IsRange
(
seld
):
start
,
stop
=
seld
.
start
,
seld
.
stop
start
,
stop
=
seld
.
start
,
seld
.
stop
if
type
(
start
)
==
InstanceType
==
type
(
stop
)
and
\
if
type
(
start
)
==
type
(
stop
)
==
type
(
self
):
start
.
__class__
==
self
.
__class__
==
stop
.
__class__
:
ss
=
str
(
start
.
seld
)
+
" thru "
+
str
(
stop
.
seld
)
ss
=
str
(
start
.
seld
)
+
" thru "
+
str
(
stop
.
seld
)
else
:
else
:
ss
=
str
(
seld
)
ss
=
str
(
seld
)
...
...
Lib/plat-mac/findertools.py
View file @
57b39e09
...
@@ -484,8 +484,8 @@ def windowposition(folder, pos=None):
...
@@ -484,8 +484,8 @@ def windowposition(folder, pos=None):
openwindow
(
fsr
)
openwindow
(
fsr
)
if
not
pos
:
if
not
pos
:
return
_getwindowposition
(
folder_alias
)
return
_getwindowposition
(
folder_alias
)
if
type
(
pos
)
==
InstanceType
:
if
aetypes
.
IsQDPoint
(
pos
)
:
#
pos might be a
QDPoint object as returned by _getwindowposition
# QDPoint object as returned by _getwindowposition
pos
=
(
pos
.
h
,
pos
.
v
)
pos
=
(
pos
.
h
,
pos
.
v
)
return
_setwindowposition
(
folder_alias
,
pos
)
return
_setwindowposition
(
folder_alias
,
pos
)
...
...
Lib/pydoc.py
View file @
57b39e09
...
@@ -1433,8 +1433,6 @@ def describe(thing):
...
@@ -1433,8 +1433,6 @@ def describe(thing):
return
'function '
+
thing
.
__name__
return
'function '
+
thing
.
__name__
if
inspect
.
ismethod
(
thing
):
if
inspect
.
ismethod
(
thing
):
return
'method '
+
thing
.
__name__
return
'method '
+
thing
.
__name__
if
type
(
thing
)
is
types
.
InstanceType
:
return
'instance of '
+
thing
.
__class__
.
__name__
return
type
(
thing
).
__name__
return
type
(
thing
).
__name__
def
locate
(
path
,
forceload
=
0
):
def
locate
(
path
,
forceload
=
0
):
...
...
Lib/test/crashers/infinite_rec_5.py
deleted
100644 → 0
View file @
b5ddcfd2
# http://python.org/sf/1267884
import
types
class
C
:
__str__
=
types
.
InstanceType
.
__str__
if
__name__
==
'__main__'
:
str
(
C
())
# segfault: infinite recursion in C
Lib/test/test_isinstance.py
View file @
57b39e09
...
@@ -15,7 +15,6 @@ class TestIsInstanceExceptions(unittest.TestCase):
...
@@ -15,7 +15,6 @@ class TestIsInstanceExceptions(unittest.TestCase):
# (leading to an "undetected error" in the debug build). Set up is,
# (leading to an "undetected error" in the debug build). Set up is,
# isinstance(inst, cls) where:
# isinstance(inst, cls) where:
#
#
# - inst isn't an InstanceType
# - cls isn't a ClassType, a TypeType, or a TupleType
# - cls isn't a ClassType, a TypeType, or a TupleType
# - cls has a __bases__ attribute
# - cls has a __bases__ attribute
# - inst has a __class__ attribute
# - inst has a __class__ attribute
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment