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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
3c4a95e1
Commit
3c4a95e1
authored
Aug 08, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Py3 test fixes
parent
ccc84a3f
Changes
1
Show 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 @
3c4a95e1
...
...
@@ -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