File tree 1 file changed +7
-15
lines changed
1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change 5
5
6
6
The PEP-249 says that database related exceptions must be inherited as follows:
7
7
8
- StandardError
8
+ Exception
9
9
|__Warning
10
10
|__Error
11
11
|__InterfaceError
29
29
import warnings
30
30
31
31
32
- try :
33
- class Warning (StandardError ):
34
- '''Exception raised for important warnings
35
- like data truncations while inserting, etc. '''
36
- except NameError :
37
- class Warning (Exception ):
38
- '''Exception raised for important warnings
39
- like data truncations while inserting, etc. '''
40
32
41
- try :
42
- class Error ( StandardError ):
43
- '''Base class for error exceptions '''
44
- except NameError :
45
- class Error (Exception ):
46
- '''Base class for error exceptions'''
33
+ class Warning ( Exception ) :
34
+ '''Exception raised for important warnings
35
+ like data truncations while inserting, etc. '''
36
+
37
+ class Error (Exception ):
38
+ '''Base class for error exceptions'''
47
39
48
40
49
41
class InterfaceError (Error ):
You can’t perform that action at this time.
0 commit comments