File tree Expand file tree Collapse file tree 4 files changed +24
-2
lines changed
Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 133133
134134# This handler is turns java imports into python imports. No mapping
135135# of packages is performed:
136- moduleImportDeclarationHandler = basic .simpleImports
136+ # moduleImportDeclarationHandler = basic.simpleImports
137137
138138# This import decl. handler can be used instead to produce comments
139139# instead of import statements:
243243 'java.lang.String' : 'str' ,
244244
245245 'Object' : 'object' ,
246+
246247 'IndexOutOfBoundsException' : 'IndexError' ,
248+ 'IOException' : 'IOError' ,
247249 }
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def simpleDocString(obj):
3636
3737
3838def commentedImports (module , expr ):
39- module .factory .comment (parent = module , left = expr , fs = 'import: {left}' )
39+ module .factory .comment (parent = module , left = expr , fs = '# import {left}' )
4040
4141
4242def simpleImports (module , expr ):
Original file line number Diff line number Diff line change 1+ import java .io .IOException ;
2+
3+ class Exception0 {
4+ static void test () throws IOException {
5+ throw new IOException ("test" );
6+ }
7+
8+ public static void main (String [] args ) {
9+ try {
10+ test ();
11+ } catch (IOException e ) {
12+ System .out .println ("catch" );
13+ } finally {
14+ System .out .println ("done" );
15+ }
16+ }
17+ }
Original file line number Diff line number Diff line change 1+ from java2python .mod import basic
2+
3+ moduleImportDeclarationHandler = basic .simpleImports
You can’t perform that action at this time.
0 commit comments