Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
b0c7a9a5
Commit
b0c7a9a5
authored
Mar 29, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I'm not sure what the deal was with this test
parent
b7ffa456
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
test/tests/descr_selfdelete.py
test/tests/descr_selfdelete.py
+16
-9
No files found.
test/tests/descr_selfdelete.py
View file @
b0c7a9a5
# expected: reffail
# Test some internals: when we execute some special functions, we often need to
# make sure to keep a reference to that function, in case that function ends up
# unsetting itself.
...
...
@@ -23,9 +22,9 @@ import sys
def
make_closure
(
f
):
def
inner
(
*
args
,
**
kw
):
print
"starting"
,
f
.
__name__
print
"starting"
,
getattr
(
f
,
'__name__'
,
type
(
f
).
__name__
)
r
=
f
(
*
args
,
**
kw
)
print
"ending"
,
f
.
__name__
print
"ending"
,
getattr
(
f
,
'__name__'
,
type
(
f
).
__name__
)
return
r
return
inner
...
...
@@ -122,7 +121,7 @@ def f():
@
make_closure
def
__set__
(
self
,
obj
,
value
,
other_arg
=
2.0
**
10
):
print
"D.__set__"
,
obj
,
value
print
"D.__set__"
,
type
(
obj
)
,
value
print
other_arg
del
D
.
__set__
print
other_arg
...
...
@@ -159,7 +158,10 @@ def f():
C
.
x
=
D
()
c
=
C
()
print
c
.
x
print
c
.
x
try
:
print
c
.
x
except
Exception
as
e
:
print
e
f
()
f
()
f
()
...
...
@@ -177,7 +179,10 @@ def f():
class
C
(
object
):
__contains__
=
make_closure
(
D
())
print
1
in
C
()
try
:
print
1
in
C
()
except
Exception
as
e
:
print
e
f
()
f
()
f
()
...
...
@@ -190,7 +195,7 @@ def f():
print
"D.__getattribute__"
del
C
.
__getattribute__
del
D
.
__get__
print
self
print
type
(
self
)
return
lambda
*
args
:
1
class
C
(
object
):
...
...
@@ -210,5 +215,7 @@ def f():
del
globals
()[
'f'
]
g
()
f
()
f
()
f
()
try
:
f
()
except
Exception
as
e
:
print
type
(
e
)
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