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 133
133
134
134
# This handler is turns java imports into python imports. No mapping
135
135
# of packages is performed:
136
- moduleImportDeclarationHandler = basic .simpleImports
136
+ # moduleImportDeclarationHandler = basic.simpleImports
137
137
138
138
# This import decl. handler can be used instead to produce comments
139
139
# instead of import statements:
243
243
'java.lang.String' : 'str' ,
244
244
245
245
'Object' : 'object' ,
246
+
246
247
'IndexOutOfBoundsException' : 'IndexError' ,
248
+ 'IOException' : 'IOError' ,
247
249
}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def simpleDocString(obj):
36
36
37
37
38
38
def 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}' )
40
40
41
41
42
42
def 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