1. jython
  2. jython

Commits

Charlie Groves  committed 88cba73

Return Py.None instead of null from builtin methods like execfile that don't return anything. This fixes the root cause of bug #1758838, so I'm rolling back r3355 since that fix is no longer needed.

  • Participants
  • Parent commits 82f4f9c
  • Branches default
  • Tags v2.2rc3

Comments (0)

Files changed (2)

File src/org/python/core/PySystemState.java

View file
         /* Print value except if null or None */
         /* After printing, also assign to '_' */
         /* Before, set '_' to None to avoid recursion */
-        if (o == null || o == Py.None)
+        if (o == Py.None)
             return;
 
         PySystemState sys = Py.getThreadState().systemState;

File src/org/python/core/__builtin__.java

View file
 			} catch (ConversionException e) {
 				throw Py.TypeError("execfile's first argument must be str");
 			}
-			return null;
+			return Py.None;
 		case 23:
 			return __builtin__.hex(arg1);
 		case 24:
 			return __builtin__.coerce(arg1, arg2);
 		case 15:
 			__builtin__.delattr(arg1, asString(arg2, "delattr(): attribute name must be string"));
-			return null;
+			return Py.None;
 		case 17:
 			return __builtin__.divmod(arg1, arg2);
 		case 18:
 			} catch (ConversionException e) {
 				throw Py.TypeError("execfile's first argument must be str");
 			}
-			return null;
+			return Py.None;
 		case 20:
 			return __builtin__.filter(arg1, arg2);
 		case 21:
 			return __builtin__.eval(arg1, arg2, arg3);
 		case 19:
 			__builtin__.execfile(asString(arg1, "execfile's first argument must be str", false), arg2, arg3);
-			return null;
+			return Py.None;
 		case 21:
 			return __builtin__.getattr(arg1, asString(arg2, "getattr(): attribute name must be string"), arg3);
 		case 33:
 			return __builtin__.reduce(arg1, arg2, arg3);
 		case 39:
 			__builtin__.setattr(arg1, asString(arg2, "setattr(): attribute name must be string"), arg3);
-			return null;
+			return Py.None;
 		case 40:
 			return __builtin__.slice(arg1, arg2, arg3);
 		case 42: