Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
9ff72ded
Commit
9ff72ded
authored
Aug 08, 2008
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
710360fe
3c4a95e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
tests/run/withstat.pyx
tests/run/withstat.pyx
+8
-5
No files found.
tests/run/withstat.pyx
View file @
9ff72ded
...
...
@@ -12,12 +12,12 @@ exit <type 'NoneType'> <type 'NoneType'> <type 'NoneType'>
>>> with_exception(None)
enter
value
exit <type 'type'> <
class 'withstat.
MyException'> <type 'traceback'>
exit <type 'type'> <
type '
MyException'> <type 'traceback'>
outer except
>>> with_exception(True)
enter
value
exit <type 'type'> <
class 'withstat.
MyException'> <type 'traceback'>
exit <type 'type'> <
type '
MyException'> <type 'traceback'>
>>> multitarget()
enter
1 2 3 4 5
...
...
@@ -32,20 +32,23 @@ enter
exit <type 'NoneType'> <type 'NoneType'> <type 'NoneType'>
"""
def
typename
(
t
):
return
u"<type '%s'>"
%
type
(
t
).
__name__
class
MyException
(
Exception
):
pass
class
ContextManager
:
class
ContextManager
(
object
)
:
def
__init__
(
self
,
value
,
exit_ret
=
None
):
self
.
value
=
value
self
.
exit_ret
=
exit_ret
def
__exit__
(
self
,
a
,
b
,
tb
):
print
"exit"
,
type
(
a
),
type
(
b
),
typ
e
(
tb
)
print
u"exit"
,
typename
(
a
),
typename
(
b
),
typenam
e
(
tb
)
return
self
.
exit_ret
def
__enter__
(
self
):
print
"enter"
print
u
"enter"
return
self
.
value
def
no_as
():
...
...
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