Skip to content

Commit

Permalink
Fix EmptyBlock and SingleSpaceSeparator issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cflee committed Mar 19, 2017
1 parent 50dcc66 commit de2cbee
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 22 deletions.
4 changes: 2 additions & 2 deletions python/common/org/python/ImportLib.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private static org.python.types.Module importNativeModule(java.lang.String impor
} catch (java.lang.ClassNotFoundException e) {
python_module = new org.python.java.Module(import_name);
python.sys.__init__.modules.__setitem__(new org.python.types.Str(import_name), python_module);
} finally {
// } finally {
// org.Python.debug("CONSTRUCTOR DONE");
}
return python_module;
Expand Down Expand Up @@ -251,7 +251,7 @@ private static org.python.types.Module importPythonModule(java.lang.String impor
} catch (java.lang.InstantiationException e) {
// e.printStackTrace();
throw new org.python.exceptions.RuntimeError(e.getCause().toString());
} finally {
// } finally {
// org.Python.debug("CONSTRUCTOR DONE");
}
return python_module;
Expand Down
2 changes: 1 addition & 1 deletion python/common/org/python/java/Function.java
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ public org.python.Object invoke(org.python.Object instance, org.python.Object[]
);
}
}
} finally {
// } finally {
// org.Python.debug("INVOKE METHOD DONE");
}
}
Expand Down
2 changes: 1 addition & 1 deletion python/common/org/python/java/Type.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public org.python.Object invoke(org.python.Object[] args, java.util.Map<java.lan
}
} catch (java.lang.InstantiationException e) {
throw new org.python.exceptions.RuntimeError(e.getCause().toString());
} finally {
// } finally {
// System.out.println("CONSTRUCTOR DONE");
}
}
Expand Down
2 changes: 1 addition & 1 deletion python/common/org/python/types/Dict.java
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public org.python.Object copy() {
public org.python.Object fromkeys(org.python.Object iterable, org.python.Object value) {
org.python.types.Dict result = new org.python.types.Dict();
try {
org.python.Iterable iter = iterable.__iter__();
org.python.Iterable iter = iterable.__iter__();
if (value == null) {
value = org.python.types.NoneType.NONE;
}
Expand Down
2 changes: 1 addition & 1 deletion python/common/org/python/types/Function.java
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ public org.python.Object invoke(org.python.Object instance, org.python.Object[]
}
throw new org.python.exceptions.RuntimeError(message);
}
} finally {
// } finally {
// System.out.println("INVOKE METHOD DONE");
}
}
Expand Down
2 changes: 1 addition & 1 deletion python/common/org/python/types/Generator.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public org.python.Object __next__() {
}
throw new org.python.exceptions.RuntimeError(message);
}
} finally {
// } finally {
// System.out.println("INVOKE METHOD DONE");
}
}
Expand Down
2 changes: 1 addition & 1 deletion python/common/org/python/types/Type.java
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ public org.python.Object invoke(org.python.Object[] args, java.util.Map<java.lan
}
} catch (java.lang.InstantiationException e) {
throw new org.python.exceptions.RuntimeError(e.getCause().toString());
} finally {
// } finally {
// System.out.println("CONSTRUCTOR DONE");
}
}
Expand Down
3 changes: 0 additions & 3 deletions python/common/python/importlib/__init__.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
__doc__ = "A pure Python implementation of import."
)
public class __init__ extends org.python.types.Module {
static {
}

@org.python.Method(
__doc__ = "Create and return a new object. See help(type) for accurate signature."
)
Expand Down
18 changes: 7 additions & 11 deletions python/testdaemon/python/testdaemon/TestDaemon.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,17 @@ public static void main(String[] args) {
method.invoke(null, (Object) inputArgs);
} catch (ReflectiveOperationException e) {
// InvocationTargetException may contain an ExitException
if (e instanceof InvocationTargetException && e.getCause() != null
&& e.getCause() instanceof ExitException) {
// System.exit() was invoked somewhere, and caught due to
// the custom SecurityManager
// Do nothing, there should be no output
} else {
if (!(e instanceof InvocationTargetException) || e.getCause() == null
|| !(e.getCause() instanceof ExitException)) {
// ClassNotFound, NoSuchMethod, IllegalAccess Exceptions
// This was _not_ a case of System.exit() being invoked somewhere
// and being caught due to the custom SecurityManager.
e.printStackTrace();
}
} catch (ExceptionInInitializerError e) {
if (e.getCause() != null && e.getCause() instanceof ExitException) {
// System.exit() was invoked somewhere, and caught due to
// the custom SecurityManager
// Do nothing, there should be no output
} else {
if (e.getCause() == null || !(e.getCause() instanceof ExitException)) {
// This was _not_ a case of System.exit() being invoked somewhere
// and being caught due to the custom SecurityManager.
e.printStackTrace();
}
} catch (Throwable e) {
Expand Down

0 comments on commit de2cbee

Please sign in to comment.