Skip to content

Commit 7d29768

Browse files
committed
测试Exception多参数场景
1 parent 938cee5 commit 7d29768

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

test/test_except.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env python
2+
# encoding: utf-8
3+
4+
"""
5+
@author: zhanghe
6+
@software: PyCharm
7+
@file: test_except.py
8+
@time: 16-4-13 下午6:38
9+
"""
10+
11+
12+
try:
13+
# raise Exception('error_message')
14+
raise Exception('error_message', 'error_code')
15+
except Exception as e:
16+
print type(e.message), e.message
17+
print type(e.args[0]), e.args[0]
18+
19+
20+
if __name__ == '__main__':
21+
pass

0 commit comments

Comments
 (0)