GeezerVison is showing github.com — convert IOException to IOError, test · stevstrong/java2python@96897b9
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: java2python/config/default.py +3-1Lines changed: 3 additions & 1 deletion | 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 | } |
Collapse file
Copy file name to clipboardExpand all lines: java2python/mod/basic.py +1-1Lines changed: 1 addition & 1 deletion | 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): |
|
Collapse file
Copy file name to clipboard +17Lines changed: 17 additions & 0 deletions | 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 | +} |
Collapse file
Copy file name to clipboard +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +from java2python.mod import basic |
| 2 | + |
| 3 | +moduleImportDeclarationHandler = basic.simpleImports |