Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding: utf8
- class MyException(Exception):
- pass
- def name_func():
- x = 1
- if x > 10:
- raise MyException('Большое')
- if x < 3:
- raise MyException('Маленькое')
- if x == 7:
- raise MyException('Нормально', 'arg1', 'arg2')
- print 'fff'
- try:
- name_func()
- except MyException as e:
- print e.message
- try:
- name_func()
- except MyException as e:
- print e.args
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement