@@ -222,21 +222,12 @@ internal unsafe static void ErrorOccurredCheck(IntPtr pointer) {
222
222
///
223
223
/// </remarks>
224
224
internal static void SetupExceptionHack ( ) {
225
- DebugUtil . Print ( "SetupExceptionHack" ) ;
226
225
ns_exc = ClassManager . GetClass ( typeof ( Exception ) ) . pyHandle ;
227
226
cache = new Hashtable ( ) ;
228
227
229
- string module_exception =
230
- #if( PYTHON34 )
231
- "builtins"
232
- #else
233
- "exceptions"
234
- #endif
235
- ;
236
-
237
228
string code =
238
- "import {0} \n " +
239
- "class Exception({0} .Exception):\n " +
229
+ "import exceptions \n " +
230
+ "class Exception(exceptions .Exception):\n " +
240
231
" _class = None\n " +
241
232
" _inner = None\n " +
242
233
" \n " +
@@ -248,7 +239,7 @@ internal static void SetupExceptionHack() {
248
239
" def __init__(self, *args, **kw):\n " +
249
240
" inst = self.__class__._class(*args, **kw)\n " +
250
241
" self.__dict__['_inner'] = inst\n " +
251
- " {0} .Exception.__init__(self, *args, **kw)\n " +
242
+ " exceptions .Exception.__init__(self, *args, **kw)\n " +
252
243
"\n " +
253
244
" def __getattr__(self, name, _marker=[]):\n " +
254
245
" inner = self.__dict__['_inner']\n " +
@@ -277,8 +268,6 @@ internal static void SetupExceptionHack() {
277
268
" name = self.__class__.__name__\n " +
278
269
" return '%s(\\ '%s\\ ',)' % (name, msg) \n " +
279
270
"\n " ;
280
- code = string . Format ( code , module_exception ) ;
281
- DebugUtil . Print ( code ) ;
282
271
283
272
IntPtr dict = Runtime . PyDict_New ( ) ;
284
273
0 commit comments