@@ -67,8 +67,8 @@ impl PyBaseException {
67
67
Ok ( ( ) )
68
68
}
69
69
70
- #[ pyproperty( name = "args" ) ]
71
- fn get_args ( & self ) -> PyTupleRef {
70
+ #[ pyproperty]
71
+ pub fn args ( & self ) -> PyTupleRef {
72
72
self . args . borrow ( ) . clone ( )
73
73
}
74
74
@@ -80,7 +80,7 @@ impl PyBaseException {
80
80
}
81
81
82
82
#[ pyproperty( name = "__traceback__" ) ]
83
- fn get_traceback ( & self ) -> Option < PyTracebackRef > {
83
+ pub fn traceback ( & self ) -> Option < PyTracebackRef > {
84
84
self . traceback . borrow ( ) . clone ( )
85
85
}
86
86
@@ -90,25 +90,23 @@ impl PyBaseException {
90
90
}
91
91
92
92
#[ pyproperty( name = "__cause__" ) ]
93
- fn get_cause ( & self ) -> Option < PyBaseExceptionRef > {
93
+ pub fn cause ( & self ) -> Option < PyBaseExceptionRef > {
94
94
self . cause . borrow ( ) . clone ( )
95
95
}
96
96
97
97
#[ pyproperty( name = "__cause__" , setter) ]
98
- fn setter_cause ( & self , cause : Option < PyBaseExceptionRef > ) -> PyResult < ( ) > {
98
+ pub fn set_cause ( & self , cause : Option < PyBaseExceptionRef > ) {
99
99
self . cause . replace ( cause) ;
100
- Ok ( ( ) )
101
100
}
102
101
103
102
#[ pyproperty( name = "__context__" ) ]
104
- fn get_context ( & self ) -> Option < PyBaseExceptionRef > {
103
+ pub fn context ( & self ) -> Option < PyBaseExceptionRef > {
105
104
self . context . borrow ( ) . clone ( )
106
105
}
107
106
108
107
#[ pyproperty( name = "__context__" , setter) ]
109
- fn setter_context ( & self , context : Option < PyBaseExceptionRef > ) -> PyResult < ( ) > {
108
+ pub fn set_context ( & self , context : Option < PyBaseExceptionRef > ) {
110
109
self . context . replace ( context) ;
111
- Ok ( ( ) )
112
110
}
113
111
114
112
#[ pyproperty( name = "__suppress_context__" ) ]
@@ -146,28 +144,6 @@ impl PyBaseException {
146
144
Err ( i) => format ! ( "{}({})" , cls. name, i. format( ", " ) ) ,
147
145
}
148
146
}
149
-
150
- pub fn args ( & self ) -> PyTupleRef {
151
- self . args . borrow ( ) . clone ( )
152
- }
153
-
154
- pub fn traceback ( & self ) -> Option < PyTracebackRef > {
155
- self . traceback . borrow ( ) . clone ( )
156
- }
157
-
158
- pub fn cause ( & self ) -> Option < PyBaseExceptionRef > {
159
- self . cause . borrow ( ) . clone ( )
160
- }
161
- pub fn set_cause ( & self , cause : Option < PyBaseExceptionRef > ) {
162
- self . cause . replace ( cause) ;
163
- }
164
-
165
- pub fn context ( & self ) -> Option < PyBaseExceptionRef > {
166
- self . context . borrow ( ) . clone ( )
167
- }
168
- pub fn set_context ( & self , context : Option < PyBaseExceptionRef > ) {
169
- self . context . replace ( context) ;
170
- }
171
147
}
172
148
173
149
/// Print exception chain
0 commit comments