Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
e276753b
Commit
e276753b
authored
May 02, 2014
by
Paul Sokolovsky
Browse files
tests: Add testcases for catching user Exception subclasses.
parent
91e556af
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/basics/subclass-native3.py
View file @
e276753b
...
...
@@ -5,3 +5,18 @@ e = MyExc(100, "Some error")
print
(
e
)
print
(
repr
(
e
))
print
(
e
.
args
)
try
:
raise
MyExc
(
"Some error"
)
except
MyExc
as
e
:
print
(
"Caught exception:"
,
repr
(
e
))
try
:
raise
MyExc
(
"Some error2"
)
except
Exception
as
e
:
print
(
"Caught exception:"
,
repr
(
e
))
try
:
raise
MyExc
(
"Some error2"
)
except
:
print
(
"Caught user exception"
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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