You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(107) |
Dec
(67) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(76) |
Feb
(125) |
Mar
(72) |
Apr
(13) |
May
(18) |
Jun
(12) |
Jul
(129) |
Aug
(47) |
Sep
(1) |
Oct
(36) |
Nov
(128) |
Dec
(124) |
2002 |
Jan
(59) |
Feb
|
Mar
(14) |
Apr
(14) |
May
(72) |
Jun
(9) |
Jul
(3) |
Aug
(5) |
Sep
(18) |
Oct
(65) |
Nov
(28) |
Dec
(12) |
2003 |
Jan
(10) |
Feb
(2) |
Mar
(4) |
Apr
(33) |
May
(21) |
Jun
(9) |
Jul
(29) |
Aug
(34) |
Sep
(4) |
Oct
(8) |
Nov
(15) |
Dec
(4) |
2004 |
Jan
(26) |
Feb
(12) |
Mar
(11) |
Apr
(9) |
May
(7) |
Jun
|
Jul
(5) |
Aug
|
Sep
(3) |
Oct
(7) |
Nov
(1) |
Dec
(10) |
2005 |
Jan
(2) |
Feb
(72) |
Mar
(16) |
Apr
(39) |
May
(48) |
Jun
(97) |
Jul
(57) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(100) |
Dec
(24) |
2006 |
Jan
(15) |
Feb
(34) |
Mar
(33) |
Apr
(31) |
May
(79) |
Jun
(64) |
Jul
(41) |
Aug
(64) |
Sep
(31) |
Oct
(46) |
Nov
(55) |
Dec
(37) |
2007 |
Jan
(32) |
Feb
(61) |
Mar
(11) |
Apr
(58) |
May
(46) |
Jun
(30) |
Jul
(94) |
Aug
(93) |
Sep
(86) |
Oct
(69) |
Nov
(125) |
Dec
(177) |
2008 |
Jan
(169) |
Feb
(97) |
Mar
(74) |
Apr
(113) |
May
(120) |
Jun
(334) |
Jul
(215) |
Aug
(237) |
Sep
(72) |
Oct
(189) |
Nov
(126) |
Dec
(160) |
2009 |
Jan
(180) |
Feb
(45) |
Mar
(98) |
Apr
(140) |
May
(151) |
Jun
(71) |
Jul
(107) |
Aug
(119) |
Sep
(73) |
Oct
(121) |
Nov
(14) |
Dec
(6) |
2010 |
Jan
(13) |
Feb
(9) |
Mar
(10) |
Apr
(64) |
May
(3) |
Jun
(16) |
Jul
(7) |
Aug
(23) |
Sep
(17) |
Oct
(37) |
Nov
(5) |
Dec
(8) |
2011 |
Jan
(10) |
Feb
(11) |
Mar
(77) |
Apr
(11) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <pj...@us...> - 2009-05-09 21:07:07
|
Revision: 6319 http://jython.svn.sourceforge.net/jython/?rev=6319&view=rev Author: pjenvey Date: 2009-05-09 21:06:49 +0000 (Sat, 09 May 2009) Log Message: ----------- coding standards Modified Paths: -------------- trunk/jython/src/org/python/util/jython.java Modified: trunk/jython/src/org/python/util/jython.java =================================================================== --- trunk/jython/src/org/python/util/jython.java 2009-05-08 06:41:51 UTC (rev 6318) +++ trunk/jython/src/org/python/util/jython.java 2009-05-09 21:06:49 UTC (rev 6319) @@ -2,8 +2,9 @@ package org.python.util; import java.io.File; -import java.io.IOException; import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import java.util.List; @@ -29,8 +30,7 @@ import org.python.modules._systemrestart; import org.python.modules.thread.thread; -public class jython -{ +public class jython { private static final String COPYRIGHT = "Type \"help\", \"copyright\", \"credits\" or \"license\" for more information."; @@ -64,32 +64,32 @@ "- : program read from stdin (default; interactive mode if a tty)\n" + "arg ... : arguments passed to program in sys.argv[1:]\n" + "Other environment variables:\n" + - "JYTHONPATH: '" + java.io.File.pathSeparator + "'-separated list of directories prefixed to the default module\n" + + "JYTHONPATH: '" + File.pathSeparator + + "'-separated list of directories prefixed to the default module\n" + " search path. The result is sys.path."; public static boolean shouldRestart; public static void runJar(String filename) { - // TBD: this is kind of gross because a local called `zipfile' just - // magically shows up in the module's globals. Either `zipfile' - // should be called `__zipfile__' or (preferrably, IMO), __run__.py - // should be imported and a main() function extracted. This - // function should be called passing zipfile in as an argument. + // TBD: this is kind of gross because a local called `zipfile' just magically + // shows up in the module's globals. Either `zipfile' should be called + // `__zipfile__' or (preferrably, IMO), __run__.py should be imported and a main() + // function extracted. This function should be called passing zipfile in as an + // argument. // - // Probably have to keep this code around for backwards - // compatibility (?) + // Probably have to keep this code around for backwards compatibility (?) try { ZipFile zip = new ZipFile(filename); ZipEntry runit = zip.getEntry("__run__.py"); - if (runit == null) + if (runit == null) { throw Py.ValueError("jar file missing '__run__.py'"); + } PyStringMap locals = new PyStringMap(); - // Stripping the stuff before the last File.separator fixes Bug - // #931129 by keeping illegal characters out of the generated - // proxy class name + // Stripping the stuff before the last File.separator fixes Bug #931129 by + // keeping illegal characters out of the generated proxy class name int beginIndex; if ((beginIndex = filename.lastIndexOf(File.separator)) != -1) { filename = filename.substring(beginIndex + 1); @@ -151,7 +151,7 @@ opts.interactive = ((PyFile)Py.defaultSystemState.stdin).isatty(); if (!opts.interactive) { PySystemState systemState = Py.getSystemState(); - systemState.ps1 = systemState.ps2 = new PyString(); + systemState.ps1 = systemState.ps2 = Py.EmptyString; } } @@ -176,13 +176,13 @@ } if (opts.division != null) { - if ("old".equals(opts.division)) + if ("old".equals(opts.division)) { Options.divisionWarning = 0; - else if ("warn".equals(opts.division)) + } else if ("warn".equals(opts.division)) { Options.divisionWarning = 1; - else if ("warnall".equals(opts.division)) + } else if ("warnall".equals(opts.division)) { Options.divisionWarning = 2; - else if ("new".equals(opts.division)) { + } else if ("new".equals(opts.division)) { Options.Qnew = true; interp.cflags.setFlag(CodeFlag.CO_FUTURE_DIVISION); } @@ -204,8 +204,7 @@ runJar(opts.filename); } else if (opts.filename.equals("-")) { try { - interp.locals.__setitem__(new PyString("__file__"), - new PyString("<stdin>")); + interp.locals.__setitem__(new PyString("__file__"), new PyString("<stdin>")); interp.execfile(System.in, "<stdin>"); } catch (Throwable t) { Py.printException(t); @@ -217,8 +216,8 @@ FileInputStream file; try { - file = new java.io.FileInputStream(new RelativeFile(opts.filename)); - } catch (java.io.FileNotFoundException e) { + file = new FileInputStream(new RelativeFile(opts.filename)); + } catch (FileNotFoundException e) { throw Py.IOError(e); } if (FileUtil.isatty(file.getFD())) { @@ -228,9 +227,9 @@ } else { interp.execfile(file, opts.filename); } - } catch(Throwable t) { - if (t instanceof PyException && - ((PyException)t).match(_systemrestart.SystemRestart)) { + } catch (Throwable t) { + if (t instanceof PyException + && ((PyException)t).match(_systemrestart.SystemRestart)) { // Shutdown this instance... shouldRestart = true; shutdownInterpreter(); @@ -248,12 +247,11 @@ } } else { - // if there was no file name on the command line, then "" is - // the first element on sys.path. This is here because if - // there /was/ a filename on the c.l., and say the -i option - // was given, sys.path[0] will have gotten filled in with the - // dir of the argument filename. - Py.getSystemState().path.insert(0, new PyString("")); + // if there was no file name on the command line, then "" is the first element + // on sys.path. This is here because if there /was/ a filename on the c.l., + // and say the -i option was given, sys.path[0] will have gotten filled in + // with the dir of the argument filename. + Py.getSystemState().path.insert(0, Py.EmptyString); if (opts.command != null) { try { @@ -285,10 +283,11 @@ opts.encoding = PySystemState.registry.getProperty( "python.console.encoding", null); } - if(opts.encoding != null) { - if(!Charset.isSupported(opts.encoding)) { + if (opts.encoding != null) { + if (!Charset.isSupported(opts.encoding)) { System.err.println(opts.encoding - + " is not a supported encoding on this JVM, so it can't be used in python.console.encoding."); + + " is not a supported encoding on this JVM, so it can't " + + "be used in python.console.encoding."); System.exit(1); } interp.cflags.encoding = opts.encoding; @@ -311,8 +310,9 @@ */ private static InteractiveConsole newInterpreter() { try { - String interpClass = PySystemState.registry.getProperty("python.console", - "org.python.util.InteractiveConsole"); + String interpClass = + PySystemState.registry.getProperty("python.console", + "org.python.util.InteractiveConsole"); return (InteractiveConsole)Class.forName(interpClass).newInstance(); } catch (Throwable t) { return new InteractiveConsole(); @@ -335,8 +335,7 @@ } } -class CommandLineOptions -{ +class CommandLineOptions { public String filename; public boolean jar, interactive, notice; public boolean runCommand, runModule; @@ -363,57 +362,50 @@ properties.put(key, value); try { System.setProperty(key, value); + } catch (SecurityException e) { + // continue } - catch (SecurityException e) {} } public boolean parse(String[] args) { - int index=0; + int index = 0; + while (index < args.length && args[index].startsWith("-")) { String arg = args[index]; if (arg.equals("-h") || arg.equals("-?") || arg.equals("--help")) { help = true; return false; - } - else if (arg.equals("-V") || arg.equals("--version")) { + } else if (arg.equals("-V") || arg.equals("--version")) { version = true; return false; - } - else if (arg.equals("-")) { - if (!fixInteractive) + } else if (arg.equals("-")) { + if (!fixInteractive) { interactive = false; + } filename = "-"; - } - else if (arg.equals("-i")) { + } else if (arg.equals("-i")) { fixInteractive = true; interactive = true; - } - else if (arg.equals("-jar")) { + } else if (arg.equals("-jar")) { jar = true; - if (!fixInteractive) + if (!fixInteractive) { interactive = false; - } - else if (arg.equals("-u")) { + } + } else if (arg.equals("-u")) { Options.unbuffered = true; - } - else if (arg.equals("-v")) { + } else if (arg.equals("-v")) { Options.verbose++; - } - else if (arg.equals("-vv")) { + } else if (arg.equals("-vv")) { Options.verbose += 2; - } - else if (arg.equals("-vvv")) { + } else if (arg.equals("-vvv")) { Options.verbose +=3 ; - } - else if (arg.equals("-S")) { + } else if (arg.equals("-S")) { Options.importSite = false; - } - else if (arg.equals("-c")) { + } else if (arg.equals("-c")) { runCommand = true; if (arg.length() > 2) { command = arg.substring(2); - } - else if ((index + 1) < args.length) { + } else if ((index + 1) < args.length) { command = args[++index]; } else { System.err.println("Argument expected for the -c option"); @@ -426,19 +418,14 @@ } index++; break; - } - else if (arg.equals("-W")) { + } else if (arg.equals("-W")) { warnoptions.add(args[++index]); - } - else if (arg.equals("-C")) { + } else if (arg.equals("-C")) { encoding = args[++index]; - } - else if (arg.equals("-E")) { - // XXX: accept -E (ignore environment variables) to be - // compatiable with CPython. do nothing for now (we - // could ignore the registry) - } - else if (arg.startsWith("-D")) { + } else if (arg.equals("-E")) { + // XXX: accept -E (ignore environment variables) to be compatiable with + // CPython. do nothing for now (we could ignore the registry) + } else if (arg.startsWith("-D")) { String key = null; String value = null; int equals = arg.indexOf("="); @@ -446,25 +433,22 @@ String arg2 = args[++index]; key = arg.substring(2, arg.length()); value = arg2; - } - else { + } else { key = arg.substring(2, equals); - value = arg.substring(equals+1, arg.length()); + value = arg.substring(equals + 1, arg.length()); } setProperty(key, value); - } - else if (arg.startsWith("-Q")) { - if (arg.length() > 2) + } else if (arg.startsWith("-Q")) { + if (arg.length() > 2) { division = arg.substring(2); - else + } else { division = args[++index]; - } - else if (arg.startsWith("-m")) { + } + } else if (arg.startsWith("-m")) { runModule = true; if (arg.length() > 2) { moduleName = arg.substring(2); - } - else if ((index + 1) < args.length) { + } else if ((index + 1) < args.length) { moduleName = args[++index]; } else { System.err.println("Argument expected for the -m option"); @@ -477,20 +461,20 @@ } index++; - int n = args.length-index+1; + int n = args.length - index + 1; argv = new String[n]; argv[0] = moduleName; for (int i = 1; index < args.length; i++, index++) { argv[i] = args[index]; } return true; - } - else { + } else { String opt = args[index]; - if (opt.startsWith("--")) + if (opt.startsWith("--")) { opt = opt.substring(2); - else if (opt.startsWith("-")) + } else if (opt.startsWith("-")) { opt = opt.substring(1); + } System.err.println("Unknown option: " + opt); return false; } @@ -499,24 +483,26 @@ notice = interactive; if (filename == null && index < args.length && command == null) { filename = args[index++]; - if (!fixInteractive) + if (!fixInteractive) { interactive = false; + } notice = false; } - if (command != null) + if (command != null) { notice = false; + } - int n = args.length-index+1; + int n = args.length - index + 1; argv = new String[n]; - //new String[args.length-index+1]; - if (filename != null) + if (filename != null) { argv[0] = filename; - else if (command != null) + } else if (command != null) { argv[0] = "-c"; - else + } else { argv[0] = ""; + } - for(int i=1; i<n; i++, index++) { + for (int i = 1; i < n; i++, index++) { argv[i] = args[index]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-08 06:42:03
|
Revision: 6318 http://jython.svn.sourceforge.net/jython/?rev=6318&view=rev Author: pjenvey Date: 2009-05-08 06:41:51 +0000 (Fri, 08 May 2009) Log Message: ----------- match slice __str__ to its __repr__ Modified Paths: -------------- trunk/jython/src/org/python/core/PySlice.java Modified: trunk/jython/src/org/python/core/PySlice.java =================================================================== --- trunk/jython/src/org/python/core/PySlice.java 2009-05-08 05:51:42 UTC (rev 6317) +++ trunk/jython/src/org/python/core/PySlice.java 2009-05-08 06:41:51 UTC (rev 6318) @@ -65,6 +65,7 @@ } } + @Override public int hashCode() { return slice___hash__(); } @@ -74,16 +75,7 @@ throw Py.TypeError(String.format("unhashable type: '%.200s'", getType().fastGetName())); } - public PyString __str__() { - return new PyString(getStart().__repr__() + ":" + getStop().__repr__() + ":" - + getStep().__repr__()); - } - - public PyString __repr__() { - return new PyString("slice(" + getStart().__repr__() + ", " + getStop().__repr__() + ", " - + getStep().__repr__() + ")"); - } - + @Override public PyObject __eq__(PyObject o) { if (getType() != o.getType() && !(getType().isSubType(o.getType()))) { return null; @@ -92,17 +84,15 @@ return Py.True; } PySlice oSlice = (PySlice)o; - if (eq(getStart(), oSlice.getStart()) && eq(getStop(), oSlice.getStop()) - && eq(getStep(), oSlice.getStep())) { - return Py.True; - } - return Py.False; + return Py.newBoolean(eq(getStart(), oSlice.getStart()) && eq(getStop(), oSlice.getStop()) + && eq(getStep(), oSlice.getStep())); } private static final boolean eq(PyObject o1, PyObject o2) { return o1._cmp(o2) == 0; } + @Override public PyObject __ne__(PyObject o) { return __eq__(o).__not__(); } @@ -221,6 +211,16 @@ throw Py.TypeError("slice indices must be integers or None or have an __index__ method"); } + @Override + public String toString() { + return slice_toString(); + } + + @ExposedMethod(names = "__repr__", doc = BuiltinDocs.slice___repr___doc) + final String slice_toString() { + return String.format("slice(%s, %s, %s)", getStart(), getStop(), getStep()); + } + public final PyObject getStart() { return start; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2009-05-08 05:51:45
|
Revision: 6317 http://jython.svn.sourceforge.net/jython/?rev=6317&view=rev Author: zyasoft Date: 2009-05-08 05:51:42 +0000 (Fri, 08 May 2009) Log Message: ----------- Added limited testing of org.python.core.PyBytecode (PBC-VM) Added Paths: ----------- trunk/jython/Lib/test/output/test_types_pyc trunk/jython/Lib/test/pbcvm/ trunk/jython/Lib/test/pbcvm/test/ trunk/jython/Lib/test/pbcvm/test/README trunk/jython/Lib/test/pbcvm/test/__init__.py trunk/jython/Lib/test/pbcvm/test/test_builtin_pyc.pyc trunk/jython/Lib/test/pbcvm/test/test_exceptions_pyc.pyc trunk/jython/Lib/test/pbcvm/test/test_types_pyc.pyc trunk/jython/Lib/test/test_pbcvm.py Added: trunk/jython/Lib/test/output/test_types_pyc =================================================================== --- trunk/jython/Lib/test/output/test_types_pyc (rev 0) +++ trunk/jython/Lib/test/output/test_types_pyc 2009-05-08 05:51:42 UTC (rev 6317) @@ -0,0 +1,15 @@ +test_types_pyc +6. Built-in types +6.1 Truth value testing +6.2 Boolean operations +6.3 Comparisons +6.4 Numeric types (mostly conversions) +6.4.1 32-bit integers +6.4.2 Long integers +6.4.3 Floating point numbers +6.5 Sequence types +6.5.1 Strings +6.5.2 Tuples [see test_tuple.py] +6.5.3 Lists [see test_list.py] +6.6 Mappings == Dictionaries [see test_dict.py] +Buffers Added: trunk/jython/Lib/test/pbcvm/test/README =================================================================== --- trunk/jython/Lib/test/pbcvm/test/README (rev 0) +++ trunk/jython/Lib/test/pbcvm/test/README 2009-05-08 05:51:42 UTC (rev 6317) @@ -0,0 +1 @@ +Contains precompiled pyc files for testing org.python.core.PyBytecode by test_pbcvm - don't delete! Added: trunk/jython/Lib/test/pbcvm/test/__init__.py =================================================================== --- trunk/jython/Lib/test/pbcvm/test/__init__.py (rev 0) +++ trunk/jython/Lib/test/pbcvm/test/__init__.py 2009-05-08 05:51:42 UTC (rev 6317) @@ -0,0 +1 @@ +# mock test directory Added: trunk/jython/Lib/test/pbcvm/test/test_builtin_pyc.pyc =================================================================== (Binary files differ) Property changes on: trunk/jython/Lib/test/pbcvm/test/test_builtin_pyc.pyc ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jython/Lib/test/pbcvm/test/test_exceptions_pyc.pyc =================================================================== (Binary files differ) Property changes on: trunk/jython/Lib/test/pbcvm/test/test_exceptions_pyc.pyc ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jython/Lib/test/pbcvm/test/test_types_pyc.pyc =================================================================== (Binary files differ) Property changes on: trunk/jython/Lib/test/pbcvm/test/test_types_pyc.pyc ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jython/Lib/test/test_pbcvm.py =================================================================== --- trunk/jython/Lib/test/test_pbcvm.py (rev 0) +++ trunk/jython/Lib/test/test_pbcvm.py 2009-05-08 05:51:42 UTC (rev 6317) @@ -0,0 +1,71 @@ +import inspect +import os.path +import sys +import unittest +from test import test_support +from regrtest import runtest + +def make_fib_function(): + from org.python.core import PyBytecode, PyFunction + co_argcount = 1 + co_nlocals = 1 + co_stacksize = 4 + co_flags = 67 + co_code = '|\x00\x00d\x01\x00j\x02\x00p\r\x00\x01|\x00\x00d\x02\x00j\x02\x00o\x08\x00\x01d\x02\x00Sn\x1d\x00\x01t\x00\x00|\x00\x00d\x03\x00\x18\x83\x01\x00t\x00\x00|\x00\x00d\x02\x00\x18\x83\x01\x00\x17Sd\x00\x00S' + co_consts = (None, 0, 1, 2) + co_names = ('fib',) + co_varnames = ('x',) + co_filename = '<fib test code>' + co_name = 'fib' + co_firstlineno = 1 + co_lnotab = '\x00\x01\x1a\x01\x08\x02' + co_freevars = () + co_cellvars = () + + c = PyBytecode( + co_argcount, co_nlocals, co_stacksize, co_flags, + co_code, co_consts, co_names, co_varnames, + co_filename, co_name, co_firstlineno, co_lnotab, co_freevars, co_cellvars) + + return PyFunction(c, globals()) + +fib = make_fib_function() + +class PyBytecodeTest(unittest.TestCase): + + def test_fib(self): + expected_fib = [1,1,2,3,5,8,13,21,34,55] + for i in range(10): + self.assertEquals(fib(i), expected_fib[i]) + +class AdhocRegrtest(unittest.TestCase): + + def setUp(self): + self.old_verbosity = test_support.verbose + test_support.verbose = 0 + import pycimport + sys.path.insert(0, os.path.join(os.path.split(inspect.getfile(self.__class__))[0], 'pbcvm')) + + def test_regrtest_pyc(self): + for test in ( + # change the names a bit so we don't have to worry about module unloading or spawning a separate JVM + # however, this testing approach too limits the tests that can be run, so we should rewrite to + # use subprocess asap + 'test_types_pyc', + 'test_exceptions_pyc'): + ok = runtest(test, generate=False, verbose=False, quiet=True, testdir=None, + huntrleaks=False, junit_xml=None) + self.assertTrue(ok > 0) + + def tearDown(self): + # typical unsafe ops we have to do in testing... + test_support.verbose = self.old_verbosity + sys.path.pop(0) + sys.meta_path.pop(0) + + +def test_main(): + test_support.run_unittest(PyBytecodeTest, AdhocRegrtest) + +if __name__ == "__main__": + test_main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <zy...@us...> - 2009-05-08 02:34:50
|
Revision: 6316 http://jython.svn.sourceforge.net/jython/?rev=6316&view=rev Author: zyasoft Date: 2009-05-08 02:34:43 +0000 (Fri, 08 May 2009) Log Message: ----------- Support PyCode#call(PyFrame) for backwards compatibility. However, this should ordinarily not be used in most calls, since it requires looking up the ThreadState. However, it will be (somewhat) more efficient in usage by code like pycimport. Modified Paths: -------------- trunk/jython/src/org/python/core/PyCode.java Modified: trunk/jython/src/org/python/core/PyCode.java =================================================================== --- trunk/jython/src/org/python/core/PyCode.java 2009-05-07 05:57:41 UTC (rev 6315) +++ trunk/jython/src/org/python/core/PyCode.java 2009-05-08 02:34:43 UTC (rev 6316) @@ -10,6 +10,10 @@ abstract public PyObject call(ThreadState state, PyFrame frame, PyObject closure); + public PyObject call(PyFrame frame) { + return call(Py.getThreadState(), frame); + } + public PyObject call(ThreadState state, PyFrame frame) { return call(state, frame, null); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2009-05-07 05:57:42
|
Revision: 6315 http://jython.svn.sourceforge.net/jython/?rev=6315&view=rev Author: otmarhumbel Date: 2009-05-07 05:57:41 +0000 (Thu, 07 May 2009) Log Message: ----------- suppress another fallthrough warning Modified Paths: -------------- trunk/jython/src/com/ziclix/python/sql/handler/InformixDataHandler.java Modified: trunk/jython/src/com/ziclix/python/sql/handler/InformixDataHandler.java =================================================================== --- trunk/jython/src/com/ziclix/python/sql/handler/InformixDataHandler.java 2009-05-07 04:15:11 UTC (rev 6314) +++ trunk/jython/src/com/ziclix/python/sql/handler/InformixDataHandler.java 2009-05-07 05:57:41 UTC (rev 6315) @@ -124,6 +124,7 @@ * @return the mapped Python object * @throws SQLException thrown for a sql exception */ + @SuppressWarnings("fallthrough") public PyObject getPyObject(ResultSet set, int col, int type) throws SQLException { PyObject obj = Py.None; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-07 04:15:21
|
Revision: 6314 http://jython.svn.sourceforge.net/jython/?rev=6314&view=rev Author: pjenvey Date: 2009-05-07 04:15:11 +0000 (Thu, 07 May 2009) Log Message: ----------- o revert the deprecated getBigDecimal postgresql driver workaround, this problem was resolved long ago o suppress warnings in the old, preserved Jython22DataHandler Modified Paths: -------------- trunk/jython/src/com/ziclix/python/sql/Jython22DataHandler.java trunk/jython/src/com/ziclix/python/sql/handler/PostgresqlDataHandler.java Modified: trunk/jython/src/com/ziclix/python/sql/Jython22DataHandler.java =================================================================== --- trunk/jython/src/com/ziclix/python/sql/Jython22DataHandler.java 2009-05-07 03:48:51 UTC (rev 6313) +++ trunk/jython/src/com/ziclix/python/sql/Jython22DataHandler.java 2009-05-07 04:15:11 UTC (rev 6314) @@ -210,6 +210,7 @@ * @param type the column type * @throws SQLException if the type is unmappable */ + @SuppressWarnings("deprecation") public PyObject getPyObject(ResultSet set, int col, int type) throws SQLException { PyObject obj = Py.None; @@ -326,6 +327,7 @@ * @param type the column type * @throws SQLException if the type is unmappable */ + @SuppressWarnings("deprecation") public PyObject getPyObject(CallableStatement stmt, int col, int type) throws SQLException { PyObject obj = Py.None; Modified: trunk/jython/src/com/ziclix/python/sql/handler/PostgresqlDataHandler.java =================================================================== --- trunk/jython/src/com/ziclix/python/sql/handler/PostgresqlDataHandler.java 2009-05-07 03:48:51 UTC (rev 6313) +++ trunk/jython/src/com/ziclix/python/sql/handler/PostgresqlDataHandler.java 2009-05-07 04:15:11 UTC (rev 6314) @@ -60,14 +60,7 @@ case Types.NUMERIC: case Types.DECIMAL: - // in JDBC 2.0, use of a scale is deprecated - // The big fix here is a problem with numeric types. It seems the ResultSet - // tries to fix a JBuilder bug (as commented in the source) by including a - // scale of 0. Well this blows up BigDecimal if the number is, say, 4.22. - // It appears the workaround is to call the deprecated method with a scale of - // -1 which forces the return of the BD without setting the scale. - BigDecimal bd = set.getBigDecimal(col, -1); - + BigDecimal bd = set.getBigDecimal(col); obj = (bd == null) ? Py.None : Py.newFloat(bd.doubleValue()); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-07 03:49:00
|
Revision: 6313 http://jython.svn.sourceforge.net/jython/?rev=6313&view=rev Author: pjenvey Date: 2009-05-07 03:48:51 +0000 (Thu, 07 May 2009) Log Message: ----------- disable Xlint:cast, unfortunately antlr.PythonParser has a ton Modified Paths: -------------- trunk/jython/build.xml Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2009-05-07 03:48:35 UTC (rev 6312) +++ trunk/jython/build.xml 2009-05-07 03:48:51 UTC (rev 6313) @@ -120,7 +120,7 @@ <property name="deprecation" value="true" /> <property name="debug" value="true" /> <property name="nowarn" value="false" /> - <property name="javac.args" value="-Xlint -Xlint:-serial -Xlint:-unchecked"/> + <property name="javac.args" value="-Xlint -Xlint:-serial -Xlint:-unchecked -Xlint:-cast"/> <!-- properties work.dir and jython.base.dir are also defined in full-preinit --> <property name="work.dir" value="${basedir}" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-07 03:48:45
|
Revision: 6312 http://jython.svn.sourceforge.net/jython/?rev=6312&view=rev Author: pjenvey Date: 2009-05-07 03:48:35 +0000 (Thu, 07 May 2009) Log Message: ----------- remove unnecessary casts Modified Paths: -------------- trunk/jython/src/org/python/core/Py.java trunk/jython/src/org/python/core/__builtin__.java trunk/jython/src/org/python/util/PythonInterpreter.java trunk/jython/src/org/python/util/jython.java trunk/jython/tests/java/org/python/antlr/PythonTreeTester.java Modified: trunk/jython/src/org/python/core/Py.java =================================================================== --- trunk/jython/src/org/python/core/Py.java 2009-05-07 01:41:35 UTC (rev 6311) +++ trunk/jython/src/org/python/core/Py.java 2009-05-07 03:48:35 UTC (rev 6312) @@ -1230,8 +1230,8 @@ throw Py.TypeError( "exec: argument 1 must be string, code or file object"); } - code = (PyCode)Py.compile_flags(contents, "<string>", CompileMode.exec, - getCompilerFlags(flags, false)); + code = Py.compile_flags(contents, "<string>", CompileMode.exec, + getCompilerFlags(flags, false)); } Py.runCode(code, locals, globals); } Modified: trunk/jython/src/org/python/core/__builtin__.java =================================================================== --- trunk/jython/src/org/python/core/__builtin__.java 2009-05-07 01:41:35 UTC (rev 6311) +++ trunk/jython/src/org/python/core/__builtin__.java 2009-05-07 03:48:35 UTC (rev 6312) @@ -527,7 +527,7 @@ PyCode code; try { - code = (PyCode)Py.compile_flags(file, name, CompileMode.exec, cflags); + code = Py.compile_flags(file, name, CompileMode.exec, cflags); } finally { try { file.close(); Modified: trunk/jython/src/org/python/util/PythonInterpreter.java =================================================================== --- trunk/jython/src/org/python/util/PythonInterpreter.java 2009-05-07 01:41:35 UTC (rev 6311) +++ trunk/jython/src/org/python/util/PythonInterpreter.java 2009-05-07 03:48:35 UTC (rev 6312) @@ -5,7 +5,6 @@ import org.python.core.CompileMode; import org.python.core.CompilerFlags; import org.python.core.Py; -import org.python.core.PyCode; import org.python.core.PyException; import org.python.core.PyFile; import org.python.core.PyFileWriter; @@ -164,7 +163,7 @@ public void execfile(java.io.InputStream s, String name) { setState(); - Py.runCode((PyCode)Py.compile_flags(s, name, CompileMode.exec, cflags), locals, locals); + Py.runCode(Py.compile_flags(s, name, CompileMode.exec, cflags), locals, locals); Py.flushLine(); } Modified: trunk/jython/src/org/python/util/jython.java =================================================================== --- trunk/jython/src/org/python/util/jython.java 2009-05-07 01:41:35 UTC (rev 6311) +++ trunk/jython/src/org/python/util/jython.java 2009-05-07 03:48:35 UTC (rev 6312) @@ -101,7 +101,7 @@ InputStream file = zip.getInputStream(runit); PyCode code; try { - code = (PyCode)Py.compile(file, "__run__", CompileMode.exec); + code = Py.compile(file, "__run__", CompileMode.exec); } finally { file.close(); } Modified: trunk/jython/tests/java/org/python/antlr/PythonTreeTester.java =================================================================== --- trunk/jython/tests/java/org/python/antlr/PythonTreeTester.java 2009-05-07 01:41:35 UTC (rev 6311) +++ trunk/jython/tests/java/org/python/antlr/PythonTreeTester.java 2009-05-07 03:48:35 UTC (rev 6312) @@ -41,13 +41,13 @@ PythonTree r = null; switch (_block) { case MODULE : - r = (PythonTree)parser.file_input().tree; + r = parser.file_input().tree; break; case INTERACTIVE : - r = (PythonTree)parser.single_input().tree; + r = parser.single_input().tree; break; case EXPRESSION : - r = (PythonTree)parser.eval_input().tree; + r = parser.eval_input().tree; break; } if (args.length > 1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-07 02:14:34
|
Revision: 6311 http://jython.svn.sourceforge.net/jython/?rev=6311&view=rev Author: pjenvey Date: 2009-05-07 01:41:35 +0000 (Thu, 07 May 2009) Log Message: ----------- o enable javac Xlint warnings, minus serial and unchecked for now as we're violating those all over the place. plus fixes for most violations o un-deprecate Py.FixedFileWrapper and PyObject._callextra -- they may have been mistakenly deprecated as they're pretty important Modified Paths: -------------- trunk/jython/build.xml trunk/jython/src/com/ziclix/python/sql/JDBC20DataHandler.java trunk/jython/src/org/python/compiler/Code.java trunk/jython/src/org/python/core/InitModule.java trunk/jython/src/org/python/core/Py.java trunk/jython/src/org/python/core/PyObject.java trunk/jython/src/org/python/core/PyString.java trunk/jython/src/org/python/core/PySystemState.java trunk/jython/src/org/python/core/imp.java trunk/jython/src/org/python/core/util/StringUtil.java trunk/jython/src/org/python/modules/_csv/PyReader.java trunk/jython/src/org/python/modules/zipimport/zipimporter.java trunk/jython/src/org/python/util/JythoncAntTask.java trunk/jython/src/org/python/util/PythonInterpreter.java Modified: trunk/jython/build.xml =================================================================== --- trunk/jython/build.xml 2009-05-07 00:58:52 UTC (rev 6310) +++ trunk/jython/build.xml 2009-05-07 01:41:35 UTC (rev 6311) @@ -117,9 +117,10 @@ <property name="build.compiler" value="modern" /> <property name="jdk.target.version" value="1.5" /> <property name="jdk.source.version" value="1.5" /> - <property name="deprecation" value="off" /> + <property name="deprecation" value="true" /> <property name="debug" value="true" /> <property name="nowarn" value="false" /> + <property name="javac.args" value="-Xlint -Xlint:-serial -Xlint:-unchecked"/> <!-- properties work.dir and jython.base.dir are also defined in full-preinit --> <property name="work.dir" value="${basedir}" /> @@ -413,6 +414,7 @@ deprecation="${deprecation}" nowarn="${nowarn}"> <include name="org/python/util/TemplateAntTask.java" /> + <compilerarg line="${javac.args}"/> </javac> </target> @@ -456,6 +458,7 @@ nowarn="${nowarn}" memoryMaximumSize="192m" fork="true"> + <compilerarg line="${javac.args}"/> <src path="${source.dir}"/> <src path="${gensrc.dir}"/> @@ -471,7 +474,9 @@ source="${jdk.source.version}" debug="${debug}" deprecation="${deprecation}" - nowarn="${nowarn}"/> + nowarn="${nowarn}"> + <compilerarg line="${javac.args}"/> + </javac> <!-- java files used by tests --> <javac srcdir="${test.source.dir}" @@ -480,7 +485,8 @@ source="${jdk.source.version}" debug="${debug}" deprecation="${deprecation}" - nowarn="${nowarn}"> + nowarn="${nowarn}"> + <compilerarg line="${javac.args}"/> <classpath refid="test.classpath" /> </javac> <javac srcdir="tests/data/initializer" @@ -490,6 +496,7 @@ debug="${debug}" deprecation="${deprecation}" nowarn="${nowarn}"> + <compilerarg line="${javac.args}"/> <classpath refid="test.classpath" /> </javac> <copy file="${source.dir}/org/python/modules/ucnhash.dat" Modified: trunk/jython/src/com/ziclix/python/sql/JDBC20DataHandler.java =================================================================== --- trunk/jython/src/com/ziclix/python/sql/JDBC20DataHandler.java 2009-05-07 00:58:52 UTC (rev 6310) +++ trunk/jython/src/com/ziclix/python/sql/JDBC20DataHandler.java 2009-05-07 01:41:35 UTC (rev 6311) @@ -52,6 +52,7 @@ * @param type * @throws SQLException */ + @SuppressWarnings("fallthrough") public void setJDBCObject(PreparedStatement stmt, int index, PyObject object, int type) throws SQLException { if (DataHandler.checkNull(stmt, index, object, type)) { Modified: trunk/jython/src/org/python/compiler/Code.java =================================================================== --- trunk/jython/src/org/python/compiler/Code.java 2009-05-07 00:58:52 UTC (rev 6310) +++ trunk/jython/src/org/python/compiler/Code.java 2009-05-07 01:41:35 UTC (rev 6311) @@ -179,6 +179,7 @@ mv.visitVarInsn(arg0, arg1); } + @SuppressWarnings("fallthrough") private int sigSize(String sig, boolean includeReturn) { int stack = 0; int i = 0; Modified: trunk/jython/src/org/python/core/InitModule.java =================================================================== --- trunk/jython/src/org/python/core/InitModule.java 2009-05-07 00:58:52 UTC (rev 6310) +++ trunk/jython/src/org/python/core/InitModule.java 2009-05-07 01:41:35 UTC (rev 6311) @@ -9,7 +9,7 @@ * @deprecated This class is deprecated. See ClassDictInit for a replacement. * @see ClassDictInit */ - +@Deprecated public interface InitModule { public abstract void initModule(PyObject dict); } Modified: trunk/jython/src/org/python/core/Py.java =================================================================== --- trunk/jython/src/org/python/core/Py.java 2009-05-07 00:58:52 UTC (rev 6310) +++ trunk/jython/src/org/python/core/Py.java 2009-05-07 01:41:35 UTC (rev 6311) @@ -1915,7 +1915,7 @@ return (objs.toArray(dest)); } } -/** @deprecated */ + class FixedFileWrapper extends StdoutWrapper { private PyObject file; Modified: trunk/jython/src/org/python/core/PyObject.java =================================================================== --- trunk/jython/src/org/python/core/PyObject.java 2009-05-07 00:58:52 UTC (rev 6310) +++ trunk/jython/src/org/python/core/PyObject.java 2009-05-07 01:41:35 UTC (rev 6311) @@ -451,7 +451,6 @@ return __call__(arg0, arg1, arg2, arg3); } - /** @deprecated **/ public PyObject _callextra(PyObject[] args, String[] keywords, PyObject starargs, Modified: trunk/jython/src/org/python/core/PyString.java =================================================================== --- trunk/jython/src/org/python/core/PyString.java 2009-05-07 00:58:52 UTC (rev 6310) +++ trunk/jython/src/org/python/core/PyString.java 2009-05-07 01:41:35 UTC (rev 6311) @@ -765,6 +765,7 @@ throw Py.TypeError("bad operand type for unary ~"); } + @SuppressWarnings("fallthrough") public PyComplex __complex__() { boolean got_re = false; boolean got_im = false; @@ -2795,6 +2796,7 @@ return buf.toString(); } + @SuppressWarnings("fallthrough") public PyString format(PyObject args) { PyObject dict = null; this.args = args; Modified: trunk/jython/src/org/python/core/PySystemState.java =================================================================== --- trunk/jython/src/org/python/core/PySystemState.java 2009-05-07 00:58:52 UTC (rev 6310) +++ trunk/jython/src/org/python/core/PySystemState.java 2009-05-07 01:41:35 UTC (rev 6311) @@ -1038,7 +1038,8 @@ // we expect an URL like jar:file:/install_dir/jython.jar!/org/python/core/PySystemState.class if (url != null) { try { - String urlString = URLDecoder.decode(url.toString()); + String urlString = URLDecoder.decode(url.toString(), + Charset.defaultCharset().name()); int jarSeparatorIndex = urlString.lastIndexOf(JAR_SEPARATOR); if (urlString.startsWith(JAR_URL_PREFIX) && jarSeparatorIndex > 0) { jarFileName = urlString.substring(JAR_URL_PREFIX.length(), jarSeparatorIndex); Modified: trunk/jython/src/org/python/core/imp.java =================================================================== --- trunk/jython/src/org/python/core/imp.java 2009-05-07 00:58:52 UTC (rev 6310) +++ trunk/jython/src/org/python/core/imp.java 2009-05-07 01:41:35 UTC (rev 6311) @@ -827,6 +827,7 @@ * replaced by importFrom with level param. Kept for backwards compatibility. * @deprecated use importFrom with level param. */ + @Deprecated public static PyObject[] importFrom(String mod, String[] names, PyFrame frame) { return importFromAs(mod, names, null, frame, DEFAULT_LEVEL); @@ -845,6 +846,7 @@ * replaced by importFromAs with level param. Kept for backwards compatibility. * @deprecated use importFromAs with level param. */ + @Deprecated public static PyObject[] importFromAs(String mod, String[] names, PyFrame frame) { return importFromAs(mod, names, null, frame, DEFAULT_LEVEL); Modified: trunk/jython/src/org/python/core/util/StringUtil.java =================================================================== --- trunk/jython/src/org/python/core/util/StringUtil.java 2009-05-07 00:58:52 UTC (rev 6310) +++ trunk/jython/src/org/python/core/util/StringUtil.java 2009-05-07 01:41:35 UTC (rev 6311) @@ -37,6 +37,7 @@ * @param len the length * @return a new String corresponding to the bytes in buf */ + @SuppressWarnings("deprecation") public static String fromBytes(byte[] buf, int off, int len) { // Yes, I known the method is deprecated, but it is the fastest // way of converting between between byte[] and String Modified: trunk/jython/src/org/python/modules/_csv/PyReader.java =================================================================== --- trunk/jython/src/org/python/modules/_csv/PyReader.java 2009-05-07 00:58:52 UTC (rev 6310) +++ trunk/jython/src/org/python/modules/_csv/PyReader.java 2009-05-07 01:41:35 UTC (rev 6311) @@ -96,6 +96,7 @@ return fields; } + @SuppressWarnings("fallthrough") private void parse_process_char(char c) { switch (state) { case START_RECORD: Modified: trunk/jython/src/org/python/modules/zipimport/zipimporter.java =================================================================== --- trunk/jython/src/org/python/modules/zipimport/zipimporter.java 2009-05-07 00:58:52 UTC (rev 6310) +++ trunk/jython/src/org/python/modules/zipimport/zipimporter.java 2009-05-07 01:41:35 UTC (rev 6311) @@ -454,7 +454,10 @@ * @param time in milliseconds, a long value * @return an int, dos style date value */ + @SuppressWarnings("deprecation") private int epochToDosDate(long time) { + // This and the other conversion methods are cut and pasted from + // java.util.zip.ZipEntry: hence the use deprecated Date APIs Date d = new Date(time); int year = d.getYear() + 1900; if (year < 1980) { @@ -469,6 +472,7 @@ * @param time in milliseconds, a long value * @return an int, dos style time value */ + @SuppressWarnings("deprecation") private int epochToDosTime(long time) { Date d = new Date(time); return d.getHours() << 11 | d.getMinutes() << 5 | d.getSeconds() >> 1; @@ -482,6 +486,7 @@ * @param dosdate a dos style date integer * @return a long time (in milliseconds) value */ + @SuppressWarnings("deprecation") private long dosTimeToEpoch(int dosTime, int dosDate) { Date d = new Date(((dosDate >> 9) & 0x7f) + 80, ((dosDate >> 5) & 0x0f) - 1, Modified: trunk/jython/src/org/python/util/JythoncAntTask.java =================================================================== --- trunk/jython/src/org/python/util/JythoncAntTask.java 2009-05-07 00:58:52 UTC (rev 6310) +++ trunk/jython/src/org/python/util/JythoncAntTask.java 2009-05-07 01:41:35 UTC (rev 6311) @@ -496,7 +496,7 @@ //get dependencies list. if( srcDir == null ) { - srcDir = project.resolveFile("."); + srcDir = getProject().resolveFile("."); } DirectoryScanner scanner = super.getDirectoryScanner(srcDir); String[] dependencies = scanner.getIncludedFiles(); Modified: trunk/jython/src/org/python/util/PythonInterpreter.java =================================================================== --- trunk/jython/src/org/python/util/PythonInterpreter.java 2009-05-07 00:58:52 UTC (rev 6310) +++ trunk/jython/src/org/python/util/PythonInterpreter.java 2009-05-07 01:41:35 UTC (rev 6311) @@ -94,6 +94,7 @@ } /** @deprecated */ + @Deprecated public void setOut(java.io.Writer outStream) { setOut(new PyFileWriter(outStream)); } @@ -113,6 +114,7 @@ } /** @deprecated */ + @Deprecated public void setErr(java.io.Writer outStream) { setErr(new PyFileWriter(outStream)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-07 00:58:53
|
Revision: 6310 http://jython.svn.sourceforge.net/jython/?rev=6310&view=rev Author: pjenvey Date: 2009-05-07 00:58:52 +0000 (Thu, 07 May 2009) Log Message: ----------- Removed merge tracking for "svnmerge" for https://jython.svn.sourceforge.net/svnroot/jython/branches/newlist Property Changed: ---------------- trunk/jython/ Property changes on: trunk/jython ___________________________________________________________________ Modified: svnmerge-integrated - /branches/newlist:1-6243 /branches/pbcvm:1-6045 + /branches/pbcvm:1-6045 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-07 00:58:35
|
Revision: 6309 http://jython.svn.sourceforge.net/jython/?rev=6309&view=rev Author: pjenvey Date: 2009-05-07 00:58:27 +0000 (Thu, 07 May 2009) Log Message: ----------- Removed merge tracking for "svnmerge" for https://jython.svn.sourceforge.net/svnroot/jython/branches/modjy Property Changed: ---------------- trunk/jython/ Property changes on: trunk/jython ___________________________________________________________________ Modified: svnmerge-integrated - /branches/modjy:1-6074 /branches/pbcvm:1-6045 /branches/newlist:1-6243 + /branches/newlist:1-6243 /branches/pbcvm:1-6045 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-07 00:53:35
|
Revision: 6308 http://jython.svn.sourceforge.net/jython/?rev=6308&view=rev Author: pjenvey Date: 2009-05-07 00:53:28 +0000 (Thu, 07 May 2009) Log Message: ----------- branches/newlist was merged to trunk in r6244, closing Removed Paths: ------------- branches/newlist/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-07 00:51:43
|
Revision: 6307 http://jython.svn.sourceforge.net/jython/?rev=6307&view=rev Author: pjenvey Date: 2009-05-07 00:51:42 +0000 (Thu, 07 May 2009) Log Message: ----------- branches/modjy was merged to trunk in r6075, closing Removed Paths: ------------- branches/modjy/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-07 00:48:19
|
Revision: 6306 http://jython.svn.sourceforge.net/jython/?rev=6306&view=rev Author: pjenvey Date: 2009-05-07 00:48:18 +0000 (Thu, 07 May 2009) Log Message: ----------- java.lang.String has cached its hashCode forever Modified Paths: -------------- trunk/jython/src/org/python/core/PyString.java Modified: trunk/jython/src/org/python/core/PyString.java =================================================================== --- trunk/jython/src/org/python/core/PyString.java 2009-05-06 20:07:47 UTC (rev 6305) +++ trunk/jython/src/org/python/core/PyString.java 2009-05-07 00:48:18 UTC (rev 6306) @@ -18,7 +18,6 @@ { public static final PyType TYPE = PyType.fromClass(PyString.class); protected String string; - private transient int cached_hashcode=0; protected transient boolean interned=false; // for PyJavaClass.init() @@ -579,9 +578,7 @@ @ExposedMethod(doc = BuiltinDocs.str___hash___doc) final int str___hash__() { - if (cached_hashcode == 0) - cached_hashcode = string.hashCode(); - return cached_hashcode; + return string.hashCode(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2009-05-06 20:07:57
|
Revision: 6305 http://jython.svn.sourceforge.net/jython/?rev=6305&view=rev Author: otmarhumbel Date: 2009-05-06 20:07:47 +0000 (Wed, 06 May 2009) Log Message: ----------- update jna to 3.0.9 update jna-posix to 1.0.1 (see also issue #1339) Modified Paths: -------------- trunk/jython/extlibs/jna-posix.jar trunk/jython/extlibs/jna.jar Modified: trunk/jython/extlibs/jna-posix.jar =================================================================== (Binary files differ) Modified: trunk/jython/extlibs/jna.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-06 08:20:26
|
Revision: 6304 http://jython.svn.sourceforge.net/jython/?rev=6304&view=rev Author: pjenvey Date: 2009-05-06 08:20:08 +0000 (Wed, 06 May 2009) Log Message: ----------- Py.matchException -> PyException.match Oh Py.matchException, how I loathe thee Modified Paths: -------------- trunk/jython/Tools/jythonc/SrcGenCompiler.py trunk/jython/bugtests/classes/test292j.java trunk/jython/src/org/python/antlr/ast/AssertDerived.java trunk/jython/src/org/python/antlr/ast/AssignDerived.java trunk/jython/src/org/python/antlr/ast/AttributeDerived.java trunk/jython/src/org/python/antlr/ast/AugAssignDerived.java trunk/jython/src/org/python/antlr/ast/BinOpDerived.java trunk/jython/src/org/python/antlr/ast/BoolOpDerived.java trunk/jython/src/org/python/antlr/ast/BreakDerived.java trunk/jython/src/org/python/antlr/ast/CallDerived.java trunk/jython/src/org/python/antlr/ast/ClassDefDerived.java trunk/jython/src/org/python/antlr/ast/CompareDerived.java trunk/jython/src/org/python/antlr/ast/ContinueDerived.java trunk/jython/src/org/python/antlr/ast/DeleteDerived.java trunk/jython/src/org/python/antlr/ast/DictDerived.java trunk/jython/src/org/python/antlr/ast/EllipsisDerived.java trunk/jython/src/org/python/antlr/ast/ExceptHandlerDerived.java trunk/jython/src/org/python/antlr/ast/ExecDerived.java trunk/jython/src/org/python/antlr/ast/ExprDerived.java trunk/jython/src/org/python/antlr/ast/ExpressionDerived.java trunk/jython/src/org/python/antlr/ast/ExtSliceDerived.java trunk/jython/src/org/python/antlr/ast/ForDerived.java trunk/jython/src/org/python/antlr/ast/FunctionDefDerived.java trunk/jython/src/org/python/antlr/ast/GeneratorExpDerived.java trunk/jython/src/org/python/antlr/ast/GlobalDerived.java trunk/jython/src/org/python/antlr/ast/IfDerived.java trunk/jython/src/org/python/antlr/ast/IfExpDerived.java trunk/jython/src/org/python/antlr/ast/ImportDerived.java trunk/jython/src/org/python/antlr/ast/ImportFromDerived.java trunk/jython/src/org/python/antlr/ast/IndexDerived.java trunk/jython/src/org/python/antlr/ast/InteractiveDerived.java trunk/jython/src/org/python/antlr/ast/LambdaDerived.java trunk/jython/src/org/python/antlr/ast/ListCompDerived.java trunk/jython/src/org/python/antlr/ast/ListDerived.java trunk/jython/src/org/python/antlr/ast/ModuleDerived.java trunk/jython/src/org/python/antlr/ast/NameDerived.java trunk/jython/src/org/python/antlr/ast/NumDerived.java trunk/jython/src/org/python/antlr/ast/PassDerived.java trunk/jython/src/org/python/antlr/ast/PrintDerived.java trunk/jython/src/org/python/antlr/ast/RaiseDerived.java trunk/jython/src/org/python/antlr/ast/ReprDerived.java trunk/jython/src/org/python/antlr/ast/ReturnDerived.java trunk/jython/src/org/python/antlr/ast/SliceDerived.java trunk/jython/src/org/python/antlr/ast/StrDerived.java trunk/jython/src/org/python/antlr/ast/SubscriptDerived.java trunk/jython/src/org/python/antlr/ast/SuiteDerived.java trunk/jython/src/org/python/antlr/ast/TryExceptDerived.java trunk/jython/src/org/python/antlr/ast/TryFinallyDerived.java trunk/jython/src/org/python/antlr/ast/TupleDerived.java trunk/jython/src/org/python/antlr/ast/UnaryOpDerived.java trunk/jython/src/org/python/antlr/ast/WhileDerived.java trunk/jython/src/org/python/antlr/ast/WithDerived.java trunk/jython/src/org/python/antlr/ast/YieldDerived.java trunk/jython/src/org/python/antlr/ast/aliasDerived.java trunk/jython/src/org/python/antlr/ast/argumentsDerived.java trunk/jython/src/org/python/antlr/ast/comprehensionDerived.java trunk/jython/src/org/python/antlr/ast/keywordDerived.java trunk/jython/src/org/python/antlr/op/AddDerived.java trunk/jython/src/org/python/antlr/op/AndDerived.java trunk/jython/src/org/python/antlr/op/AugLoadDerived.java trunk/jython/src/org/python/antlr/op/AugStoreDerived.java trunk/jython/src/org/python/antlr/op/BitAndDerived.java trunk/jython/src/org/python/antlr/op/BitOrDerived.java trunk/jython/src/org/python/antlr/op/BitXorDerived.java trunk/jython/src/org/python/antlr/op/DelDerived.java trunk/jython/src/org/python/antlr/op/DivDerived.java trunk/jython/src/org/python/antlr/op/EqDerived.java trunk/jython/src/org/python/antlr/op/FloorDivDerived.java trunk/jython/src/org/python/antlr/op/GtDerived.java trunk/jython/src/org/python/antlr/op/GtEDerived.java trunk/jython/src/org/python/antlr/op/InDerived.java trunk/jython/src/org/python/antlr/op/InvertDerived.java trunk/jython/src/org/python/antlr/op/IsDerived.java trunk/jython/src/org/python/antlr/op/IsNotDerived.java trunk/jython/src/org/python/antlr/op/LShiftDerived.java trunk/jython/src/org/python/antlr/op/LoadDerived.java trunk/jython/src/org/python/antlr/op/LtDerived.java trunk/jython/src/org/python/antlr/op/LtEDerived.java trunk/jython/src/org/python/antlr/op/ModDerived.java trunk/jython/src/org/python/antlr/op/MultDerived.java trunk/jython/src/org/python/antlr/op/NotDerived.java trunk/jython/src/org/python/antlr/op/NotEqDerived.java trunk/jython/src/org/python/antlr/op/NotInDerived.java trunk/jython/src/org/python/antlr/op/OrDerived.java trunk/jython/src/org/python/antlr/op/ParamDerived.java trunk/jython/src/org/python/antlr/op/PowDerived.java trunk/jython/src/org/python/antlr/op/RShiftDerived.java trunk/jython/src/org/python/antlr/op/StoreDerived.java trunk/jython/src/org/python/antlr/op/SubDerived.java trunk/jython/src/org/python/antlr/op/UAddDerived.java trunk/jython/src/org/python/antlr/op/USubDerived.java trunk/jython/src/org/python/compiler/CodeCompiler.java trunk/jython/src/org/python/compiler/Module.java trunk/jython/src/org/python/compiler/pbc/BytecodeCompiler.java trunk/jython/src/org/python/core/AstList.java trunk/jython/src/org/python/core/BaseSet.java trunk/jython/src/org/python/core/ClasspathPyImporterDerived.java trunk/jython/src/org/python/core/FunctionThread.java trunk/jython/src/org/python/core/Py.java trunk/jython/src/org/python/core/PyArrayDerived.java trunk/jython/src/org/python/core/PyBaseExceptionDerived.java trunk/jython/src/org/python/core/PyBooleanDerived.java trunk/jython/src/org/python/core/PyBytecode.java trunk/jython/src/org/python/core/PyCallIter.java trunk/jython/src/org/python/core/PyClassMethodDerived.java trunk/jython/src/org/python/core/PyComplex.java trunk/jython/src/org/python/core/PyComplexDerived.java trunk/jython/src/org/python/core/PyDictionary.java trunk/jython/src/org/python/core/PyDictionaryDerived.java trunk/jython/src/org/python/core/PyEnumerateDerived.java trunk/jython/src/org/python/core/PyException.java trunk/jython/src/org/python/core/PyFastSequenceIter.java trunk/jython/src/org/python/core/PyFileDerived.java trunk/jython/src/org/python/core/PyFloat.java trunk/jython/src/org/python/core/PyFloatDerived.java trunk/jython/src/org/python/core/PyFrame.java trunk/jython/src/org/python/core/PyFrozenSetDerived.java trunk/jython/src/org/python/core/PyInstance.java trunk/jython/src/org/python/core/PyInteger.java trunk/jython/src/org/python/core/PyIntegerDerived.java trunk/jython/src/org/python/core/PyList.java trunk/jython/src/org/python/core/PyListDerived.java trunk/jython/src/org/python/core/PyLong.java trunk/jython/src/org/python/core/PyLongDerived.java trunk/jython/src/org/python/core/PyModuleDerived.java trunk/jython/src/org/python/core/PyObject.java trunk/jython/src/org/python/core/PyObjectDerived.java trunk/jython/src/org/python/core/PyPropertyDerived.java trunk/jython/src/org/python/core/PySequenceIter.java trunk/jython/src/org/python/core/PySetDerived.java trunk/jython/src/org/python/core/PySlice.java trunk/jython/src/org/python/core/PySliceDerived.java trunk/jython/src/org/python/core/PyString.java trunk/jython/src/org/python/core/PyStringDerived.java trunk/jython/src/org/python/core/PyStringMap.java trunk/jython/src/org/python/core/PySuperDerived.java trunk/jython/src/org/python/core/PySystemState.java trunk/jython/src/org/python/core/PyTupleDerived.java trunk/jython/src/org/python/core/PyTypeDerived.java trunk/jython/src/org/python/core/PyUnicodeDerived.java trunk/jython/src/org/python/core/__builtin__.java trunk/jython/src/org/python/core/imp.java trunk/jython/src/org/python/core/io/BufferedIOMixin.java trunk/jython/src/org/python/core/io/IOBase.java trunk/jython/src/org/python/modules/PyTeeIterator.java trunk/jython/src/org/python/modules/_collections/PyDefaultDictDerived.java trunk/jython/src/org/python/modules/_collections/PyDeque.java trunk/jython/src/org/python/modules/_collections/PyDequeDerived.java trunk/jython/src/org/python/modules/_csv/PyDialectDerived.java trunk/jython/src/org/python/modules/_functools/PyPartialDerived.java trunk/jython/src/org/python/modules/_weakref/ReferenceTypeDerived.java trunk/jython/src/org/python/modules/binascii.java trunk/jython/src/org/python/modules/itertools.java trunk/jython/src/org/python/modules/random/PyRandomDerived.java trunk/jython/src/org/python/modules/thread/PyLocalDerived.java trunk/jython/src/org/python/modules/zipimport/zipimporterDerived.java trunk/jython/src/org/python/util/InteractiveConsole.java trunk/jython/src/org/python/util/InteractiveInterpreter.java trunk/jython/src/org/python/util/jython.java trunk/jython/src/templates/object.derived trunk/jython/tests/java/org/python/expose/generate/MethodExposerTest.java trunk/jython/tests/java/org/python/tests/CustomizableMapHolder.java Modified: trunk/jython/Tools/jythonc/SrcGenCompiler.py =================================================================== --- trunk/jython/Tools/jythonc/SrcGenCompiler.py 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/Tools/jythonc/SrcGenCompiler.py 2009-05-06 08:20:08 UTC (rev 6304) @@ -969,8 +969,7 @@ continue type = self.visit(exchandler.type) - t = jast.InvokeStatic("Py", "matchException", - [exctmp, type.asAny()]) + t = jast.Invoke(exctmp, "match", [type.asAny()]) newbody = [] if exchandler.name is not None: Modified: trunk/jython/bugtests/classes/test292j.java =================================================================== --- trunk/jython/bugtests/classes/test292j.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/bugtests/classes/test292j.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -10,7 +10,7 @@ try { __builtin__.__import__("test292j1"); } catch (PyException exc) { - if (!Py.matchException(exc, Py.ImportError)) + if (!exc.match(Py.ImportError)) throw exc; } } Modified: trunk/jython/src/org/python/antlr/ast/AssertDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/AssertDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/AssertDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/AssignDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/AssignDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/AssignDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/AttributeDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/AttributeDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/AttributeDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/AugAssignDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/AugAssignDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/AugAssignDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/BinOpDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/BinOpDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/BinOpDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/BoolOpDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/BoolOpDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/BoolOpDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/BreakDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/BreakDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/BreakDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/CallDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/CallDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/CallDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/ClassDefDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ClassDefDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/ClassDefDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/CompareDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/CompareDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/CompareDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/ContinueDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ContinueDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/ContinueDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/DeleteDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/DeleteDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/DeleteDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/DictDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/DictDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/DictDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/EllipsisDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/EllipsisDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/EllipsisDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/ExceptHandlerDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ExceptHandlerDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/ExceptHandlerDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/ExecDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ExecDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/ExecDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/ExprDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ExprDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/ExprDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/ExpressionDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ExpressionDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/ExpressionDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/ExtSliceDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ExtSliceDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/ExtSliceDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/ForDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ForDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/ForDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/FunctionDefDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/FunctionDefDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/FunctionDefDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/GeneratorExpDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/GeneratorExpDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/GeneratorExpDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/GlobalDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/GlobalDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/GlobalDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/IfDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/IfDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/IfDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/IfExpDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/IfExpDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/IfExpDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/ImportDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ImportDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/ImportDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/ImportFromDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/ImportFromDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/ImportFromDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/IndexDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/IndexDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/IndexDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger(key)); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -1000,7 +1000,7 @@ } // else: pass through to __getitem__ invocation } } catch (PyException e) { - if (!Py.matchException(e,Py.AttributeError)) { + if (!e.match(Py.AttributeError)) { throw e; } else { firstAttributeError=e; // saved to avoid swallowing custom AttributeErrors Modified: trunk/jython/src/org/python/antlr/ast/InteractiveDerived.java =================================================================== --- trunk/jython/src/org/python/antlr/ast/InteractiveDerived.java 2009-05-06 05:46:00 UTC (rev 6303) +++ trunk/jython/src/org/python/antlr/ast/InteractiveDerived.java 2009-05-06 08:20:08 UTC (rev 6304) @@ -840,7 +840,7 @@ try { return impl.__get__(this,self_type).__call__(); } catch (PyException exc) { - if (Py.matchException(exc,Py.StopIteration)) + if (exc.match(Py.StopIteration)) return null; throw exc; } @@ -855,7 +855,7 @@ try { return impl.__get__(this,self_type).__call__(key); } catch (PyException exc) { - if (Py.matchException(exc,Py.LookupError)) + if (exc.match(Py.LookupError)) return null; throw exc; } @@ -869,7 +869,7 @@ try { return impl.__get__(this,self_type).__call__(new PyInteger... [truncated message content] |
From: <pj...@us...> - 2009-05-06 05:46:17
|
Revision: 6303 http://jython.svn.sourceforge.net/jython/?rev=6303&view=rev Author: pjenvey Date: 2009-05-06 05:46:00 +0000 (Wed, 06 May 2009) Log Message: ----------- fix binops disallowing right side binop attempts (throwing their own TypeErrors), cleanup _binary_sanity_check Modified Paths: -------------- trunk/jython/Lib/test/test_set_jy.py trunk/jython/src/org/python/core/BaseSet.java Modified: trunk/jython/Lib/test/test_set_jy.py =================================================================== --- trunk/jython/Lib/test/test_set_jy.py 2009-05-06 05:25:18 UTC (rev 6302) +++ trunk/jython/Lib/test/test_set_jy.py 2009-05-06 05:46:00 UTC (rev 6303) @@ -1,11 +1,30 @@ +import unittest from test import test_support -import unittest -from java.util import Random -from javatests import PySetInJavaTest +if test_support.is_jython: + from java.util import Random + from javatests import PySetInJavaTest -class SetInJavaTest(unittest.TestCase): - "Tests for derived dict behaviour" +class SetTestCase(unittest.TestCase): + + def test_binops(self): + class Foo(object): + __rsub__ = lambda self, other: 'rsub' + __ror__ = lambda self, other: 'ror' + __rand__ = lambda self, other: 'rand' + __rxor__ = lambda self, other: 'rxor' + foo = Foo() + s = set() + self.assertEqual(s - foo, 'rsub') + self.assertEqual(s | foo, 'ror') + self.assertEqual(s & foo, 'rand') + self.assertEqual(s ^ foo, 'rxor') + + +class SetInJavaTestCase(unittest.TestCase): + + """Tests for derived dict behaviour""" + def test_using_PySet_as_Java_Set(self): PySetInJavaTest.testPySetAsJavaSet() @@ -16,20 +35,26 @@ if isinstance(v, unicode): self.assertEquals("value", v) else: - v.nextInt()#Should be a java.util.Random; ensure we can call it + # Should be a java.util.Random; ensure we can call it + v.nextInt() def test_java_accessing_items_added_in_python(self): - # Test a type that should be coerced into a Java type, a Java instance - # that should be wrapped, and a Python instance that should pass - # through as itself with str, Random and tuple respectively. + # Test a type that should be coerced into a Java type, a Java + # instance that should be wrapped, and a Python instance that + # should pass through as itself with str, Random and tuple + # respectively. s = set(["value", Random(), ("tuple", "of", "stuff")]) PySetInJavaTest.accessAndRemovePySetItems(s) - self.assertEquals(0, len(s))# Check that the Java removal affected the underlying set - + # Check that the Java removal affected the underlying set + self.assertEquals(0, len(s)) def test_main(): - test_support.run_unittest(SetInJavaTest) + tests = [SetTestCase] + if test_support.is_jython: + tests.append(SetInJavaTestCase) + test_support.run_unittest(*tests) + if __name__ == '__main__': test_main() Modified: trunk/jython/src/org/python/core/BaseSet.java =================================================================== --- trunk/jython/src/org/python/core/BaseSet.java 2009-05-06 05:25:18 UTC (rev 6302) +++ trunk/jython/src/org/python/core/BaseSet.java 2009-05-06 05:46:00 UTC (rev 6303) @@ -58,7 +58,7 @@ final PyObject baseset___or__(PyObject other) { if (!(other instanceof BaseSet)) { - throw Py.TypeError("Not Implemented"); + return null; } return baseset_union(other); } @@ -78,7 +78,7 @@ final PyObject baseset___and__(PyObject other) { if (!(other instanceof BaseSet)) { - throw Py.TypeError("Not Implemented"); + return null; } return baseset_intersection(other); } @@ -98,7 +98,7 @@ final PyObject baseset___sub__(PyObject other) { if (!(other instanceof BaseSet)) { - throw Py.TypeError("Not Implemented"); + return null; } return baseset_difference(other); } @@ -135,7 +135,7 @@ final PyObject baseset___xor__(PyObject other) { if (!(other instanceof BaseSet)) { - throw Py.TypeError("Not Implemented"); + return null; } return baseset_symmetric_difference(other); } @@ -266,8 +266,7 @@ } final PyObject baseset___le__(PyObject other) { - _binary_sanity_check(other); - return baseset_issubset(other); + return baseset_issubset(asBaseSet(other)); } public PyObject __ge__(PyObject other) { @@ -275,8 +274,7 @@ } final PyObject baseset___ge__(PyObject other) { - _binary_sanity_check(other); - return baseset_issuperset(other); + return baseset_issuperset(asBaseSet(other)); } public PyObject __lt__(PyObject other) { @@ -284,7 +282,7 @@ } final PyObject baseset___lt__(PyObject other) { - BaseSet bs = _binary_sanity_check(other); + BaseSet bs = asBaseSet(other); return Py.newBoolean(size() < bs.size() && baseset_issubset(other).__nonzero__()); } @@ -293,7 +291,7 @@ } final PyObject baseset___gt__(PyObject other) { - BaseSet bs = _binary_sanity_check(other); + BaseSet bs = asBaseSet(other); return Py.newBoolean(size() > bs.size() && baseset_issuperset(other).__nonzero__()); } @@ -385,12 +383,18 @@ return buf.toString(); } - protected final BaseSet _binary_sanity_check(PyObject other) throws PyIgnoreMethodTag { - try { + /** + * Casts other as BaseSet, throwing a TypeError tailored for the rich comparison + * methods when not applicable. + * + * @param other a PyObject + * @return a BaseSet + */ + protected final BaseSet asBaseSet(PyObject other) { + if (other instanceof BaseSet) { return (BaseSet)other; - } catch (ClassCastException e) { - throw Py.TypeError("Binary operation only permitted between sets"); } + throw Py.TypeError("can only compare to a set"); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-06 05:25:24
|
Revision: 6302 http://jython.svn.sourceforge.net/jython/?rev=6302&view=rev Author: pjenvey Date: 2009-05-06 05:25:18 +0000 (Wed, 06 May 2009) Log Message: ----------- o have API methods call into final exposed methods, simplify issuperset, coding standards o enable set's test_weakref Modified Paths: -------------- trunk/jython/Lib/test/test_set.py trunk/jython/src/org/python/core/BaseSet.java Modified: trunk/jython/Lib/test/test_set.py =================================================================== --- trunk/jython/Lib/test/test_set.py 2009-05-06 05:20:34 UTC (rev 6301) +++ trunk/jython/Lib/test/test_set.py 2009-05-06 05:25:18 UTC (rev 6302) @@ -1,5 +1,6 @@ import unittest from test import test_support +from test_weakref import extra_collect from weakref import proxy import operator import copy @@ -227,7 +228,7 @@ # Create a nest of cycles to exercise overall ref count check class A: pass - s = set([A() for i in xrange(1000)]) + s = set(A() for i in xrange(1000)) for elem in s: elem.cycle = s elem.sub = elem @@ -278,25 +279,25 @@ fo.close() os.remove(test_support.TESTFN) -# XXX: tests cpython internals (caches key hashes) -# def test_do_not_rehash_dict_keys(self): -# n = 10 -# d = dict.fromkeys(map(HashCountingInt, xrange(n))) -# self.assertEqual(sum([elem.hash_count for elem in d]), n) -# s = self.thetype(d) -# self.assertEqual(sum([elem.hash_count for elem in d]), n) -# s.difference(d) -# self.assertEqual(sum([elem.hash_count for elem in d]), n) -# if hasattr(s, 'symmetric_difference_update'): -# s.symmetric_difference_update(d) -# self.assertEqual(sum([elem.hash_count for elem in d]), n) -# d2 = dict.fromkeys(set(d)) -# self.assertEqual(sum([elem.hash_count for elem in d]), n) -# d3 = dict.fromkeys(frozenset(d)) -# self.assertEqual(sum([elem.hash_count for elem in d]), n) -# d3 = dict.fromkeys(frozenset(d), 123) -# self.assertEqual(sum([elem.hash_count for elem in d]), n) -# self.assertEqual(d3, dict.fromkeys(d, 123)) + # XXX: Tests CPython internals (caches key hashes) + def _test_do_not_rehash_dict_keys(self): + n = 10 + d = dict.fromkeys(map(HashCountingInt, xrange(n))) + self.assertEqual(sum(elem.hash_count for elem in d), n) + s = self.thetype(d) + self.assertEqual(sum(elem.hash_count for elem in d), n) + s.difference(d) + self.assertEqual(sum(elem.hash_count for elem in d), n) + if hasattr(s, 'symmetric_difference_update'): + s.symmetric_difference_update(d) + self.assertEqual(sum(elem.hash_count for elem in d), n) + d2 = dict.fromkeys(set(d)) + self.assertEqual(sum(elem.hash_count for elem in d), n) + d3 = dict.fromkeys(frozenset(d)) + self.assertEqual(sum(elem.hash_count for elem in d), n) + d3 = dict.fromkeys(frozenset(d), 123) + self.assertEqual(sum(elem.hash_count for elem in d), n) + self.assertEqual(d3, dict.fromkeys(d, 123)) class TestSet(TestJointOps): thetype = set @@ -478,13 +479,13 @@ t ^= t self.assertEqual(t, self.thetype()) -# XXX: CPython gc-specific -# def test_weakref(self): -# s = self.thetype('gallahad') -# p = proxy(s) -# self.assertEqual(str(p), str(s)) -# s = None -# self.assertRaises(ReferenceError, str, p) + def test_weakref(self): + s = self.thetype('gallahad') + p = proxy(s) + self.assertEqual(str(p), str(s)) + s = None + extra_collect() + self.assertRaises(ReferenceError, str, p) # C API test only available in a debug build if hasattr(set, "test_c_api"): @@ -560,15 +561,15 @@ f = self.thetype('abcdcda') self.assertEqual(hash(f), hash(f)) -# XXX: tied to cpython's hash implementation -# def test_hash_effectiveness(self): -# n = 13 -# hashvalues = set() -# addhashvalue = hashvalues.add -# elemmasks = [(i+1, 1<<i) for i in range(n)] -# for i in xrange(2**n): -# addhashvalue(hash(frozenset([e for e, m in elemmasks if m&i]))) -# self.assertEqual(len(hashvalues), 2**n) + # XXX: tied to CPython's hash implementation + def _test_hash_effectiveness(self): + n = 13 + hashvalues = set() + addhashvalue = hashvalues.add + elemmasks = [(i+1, 1<<i) for i in range(n)] + for i in xrange(2**n): + addhashvalue(hash(frozenset([e for e, m in elemmasks if m&i]))) + self.assertEqual(len(hashvalues), 2**n) class FrozenSetSubclass(frozenset): pass @@ -683,11 +684,12 @@ def test_iteration(self): for v in self.set: self.assert_(v in self.values) -# XXX: jython does not use length_hint -# setiter = iter(self.set) -# # note: __length_hint__ is an internal undocumented API, -# # don't rely on it in your own programs -# self.assertEqual(setiter.__length_hint__(), len(self.set)) + # XXX: jython does not use length_hint + if not test_support.is_jython: + setiter = iter(self.set) + # note: __length_hint__ is an internal undocumented API, + # don't rely on it in your own programs + self.assertEqual(setiter.__length_hint__(), len(self.set)) def test_pickling(self): p = pickle.dumps(self.set) Modified: trunk/jython/src/org/python/core/BaseSet.java =================================================================== --- trunk/jython/src/org/python/core/BaseSet.java 2009-05-06 05:20:34 UTC (rev 6301) +++ trunk/jython/src/org/python/core/BaseSet.java 2009-05-06 05:25:18 UTC (rev 6302) @@ -1,3 +1,4 @@ +/* Copyright (c) Jython Developers */ package org.python.core; import java.lang.reflect.Array; @@ -48,8 +49,7 @@ * The union of <code>this</code> with <code>other</code>. <p/> <br/> (I.e. all elements * that are in either set) * - * @param other - * A <code>BaseSet</code> instance. + * @param other A <code>BaseSet</code> instance. * @return The union of the two sets as a new set. */ public PyObject __or__(PyObject other) { @@ -100,7 +100,7 @@ if (!(other instanceof BaseSet)) { throw Py.TypeError("Not Implemented"); } - return difference(other); + return baseset_difference(other); } public PyObject difference(PyObject other) { @@ -108,15 +108,15 @@ } final PyObject baseset_difference(PyObject other) { - BaseSet bs = (other instanceof BaseSet) ? (BaseSet)other : new PySet(other); + BaseSet bs = other instanceof BaseSet ? (BaseSet)other : new PySet(other); Set<PyObject> set = bs._set; BaseSet o = BaseSet.makeNewSet(getType()); + for (PyObject p : _set) { if (!set.contains(p)) { o._set.add(p); } } - return o; } @@ -137,7 +137,7 @@ if (!(other instanceof BaseSet)) { throw Py.TypeError("Not Implemented"); } - return symmetric_difference(other); + return baseset_symmetric_difference(other); } public PyObject symmetric_difference(PyObject other) { @@ -145,7 +145,7 @@ } final PyObject baseset_symmetric_difference(PyObject other) { - BaseSet bs = (other instanceof BaseSet) ? (BaseSet)other : new PySet(other); + BaseSet bs = other instanceof BaseSet ? (BaseSet)other : new PySet(other); BaseSet o = BaseSet.makeNewSet(getType()); for (PyObject p : _set) { if (!bs._set.contains(p)) { @@ -201,13 +201,13 @@ final PyObject baseset___iter__() { return new PyIterator() { - private int size = _set.size(); + private int size = size(); private Iterator<PyObject> iterator = _set.iterator(); @Override public PyObject __iternext__() { - if (_set.size() != size) { + if (size != size()) { throw Py.RuntimeError("set changed size during iteration"); } if (iterator.hasNext()) { @@ -255,7 +255,7 @@ } final PyObject baseset___ne__(PyObject other) { - if(other instanceof BaseSet) { + if (other instanceof BaseSet) { return Py.newBoolean(!_set.equals(((BaseSet)other)._set)); } return Py.True; @@ -285,8 +285,7 @@ final PyObject baseset___lt__(PyObject other) { BaseSet bs = _binary_sanity_check(other); - return Py.newBoolean(__len__() < bs.__len__() - && baseset_issubset(other).__nonzero__()); + return Py.newBoolean(size() < bs.size() && baseset_issubset(other).__nonzero__()); } public PyObject __gt__(PyObject other) { @@ -295,8 +294,7 @@ final PyObject baseset___gt__(PyObject other) { BaseSet bs = _binary_sanity_check(other); - return Py.newBoolean(__len__() > bs.__len__() - && baseset_issuperset(other).__nonzero__()); + return Py.newBoolean(size() > bs.size() && baseset_issuperset(other).__nonzero__()); } /** @@ -326,11 +324,11 @@ final PyObject baseset_intersection(PyObject other) { PyObject little, big; - if(!(other instanceof BaseSet)) { + if (!(other instanceof BaseSet)) { other = new PySet(other); } - if (__len__() <= __builtin__.len(other)) { + if (size() <= __builtin__.len(other)) { little = this; big = other; } else { @@ -348,8 +346,8 @@ } final PyObject baseset_issubset(PyObject other) { - BaseSet bs = (other instanceof BaseSet) ? (BaseSet)other : new PySet(other); - if (__len__() > bs.__len__()) { + BaseSet bs = other instanceof BaseSet ? (BaseSet)other : new PySet(other); + if (size() > bs.size()) { return Py.False; } for (Object p : _set) { @@ -361,16 +359,8 @@ } final PyObject baseset_issuperset(PyObject other) { - BaseSet bs = (other instanceof BaseSet) ? (BaseSet)other : new PySet(other); - if (__len__() < bs.__len__()) { - return Py.False; - } - for (Object p : bs._set) { - if (!_set.contains(p)) { - return Py.False; - } - } - return Py.True; + BaseSet bs = other instanceof BaseSet ? (BaseSet)other : new PySet(other); + return bs.baseset_issubset(this); } public String toString() { @@ -414,10 +404,8 @@ * can override, say, __hash__ and all of a sudden you can't assume that a non-PyFrozenSet is * unhashable anymore. * - * @param pye - * The exception thrown from a hashable operation. - * @param value - * The object which was unhashable. + * @param pye The exception thrown from a hashable operation. + * @param value The object which was unhashable. * @return A PyFrozenSet if appropriate, otherwise the pye is rethrown */ protected final PyFrozenSet asFrozen(PyException pye, PyObject value) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-06 05:20:50
|
Revision: 6301 http://jython.svn.sourceforge.net/jython/?rev=6301&view=rev Author: pjenvey Date: 2009-05-06 05:20:34 +0000 (Wed, 06 May 2009) Log Message: ----------- whitespace Modified Paths: -------------- trunk/jython/Lib/test/test_descr_jy.py Modified: trunk/jython/Lib/test/test_descr_jy.py =================================================================== --- trunk/jython/Lib/test/test_descr_jy.py 2009-05-05 21:12:43 UTC (rev 6300) +++ trunk/jython/Lib/test/test_descr_jy.py 2009-05-06 05:20:34 UTC (rev 6301) @@ -17,6 +17,7 @@ old = Old() new = New() + class TestDescrTestCase(unittest.TestCase): def test_class_dict_is_copy(self): @@ -393,12 +394,12 @@ except AttributeError, e: self.assertEquals("Custom message", str(e)) -# try to test more exhaustively binop overriding combination cases class Base(object): def __init__(self, name): self.name = name + def lookup_where(obj, name): mro = type(obj).__mro__ for t in mro: @@ -406,6 +407,7 @@ return t.__dict__[name], t return None, None + def refop(x, y, opname, ropname): # this has been validated by running the tests on top of cpython # so for the space of possibilities that the tests touch it is known @@ -418,14 +420,14 @@ if op is None and rop is not None: return rop(y, x) if rop and where1 is not where2: - if (issubclass(t2, t1) and not issubclass(where1, where2) - and not issubclass(t1, where2) - ): + if (issubclass(t2, t1) and not issubclass(where1, where2) and + not issubclass(t1, where2)): return rop(y, x) if op is None: return "TypeError" return op(x,y) + def do_test(X, Y, name, impl): x = X('x') y = Y('y') @@ -452,7 +454,7 @@ return f = lambda self, other: (n, self.name, other.name) - if n%2 == 0: + if n % 2 == 0: name = opname else: name = ropname @@ -462,23 +464,27 @@ continue if C is not object: setattr(C, name, f) - override_in_hier(n-1) - if C is not object: + override_in_hier(n - 1) + if C is not object: delattr(C, name) override_in_hier() #print count[0] return fail + class BinopCombinationsTestCase(unittest.TestCase): - + + """Try to test more exhaustively binop overriding combination + cases""" + def test_binop_combinations_mul(self): class X(Base): pass class Y(X): pass - fail = do_test(X, Y, 'mul', lambda x,y: x*y) + fail = do_test(X, Y, 'mul', lambda x, y: x*y) #print len(fail) self.assert_(not fail) @@ -488,9 +494,9 @@ class Y(X): pass - fail = do_test(X, Y, 'sub', lambda x,y: x-y) + fail = do_test(X, Y, 'sub', lambda x, y: x-y) #print len(fail) - self.assert_(not fail) + self.assert_(not fail) def test_binop_combinations_pow(self): class X(Base): @@ -498,9 +504,9 @@ class Y(X): pass - fail = do_test(X, Y, 'pow', lambda x,y: x**y) + fail = do_test(X, Y, 'pow', lambda x, y: x**y) #print len(fail) - self.assert_(not fail) + self.assert_(not fail) def test_binop_combinations_more_exhaustive(self): class X(Base): @@ -524,10 +530,11 @@ class Y(C1, X1, C2): pass - fail = do_test(X, Y, 'sub', lambda x,y: x-y) + fail = do_test(X, Y, 'sub', lambda x, y: x - y) #print len(fail) self.assert_(not fail) + def test_main(): test_support.run_unittest(TestDescrTestCase, SubclassDescrTestCase, @@ -536,5 +543,6 @@ GetAttrTestCase, BinopCombinationsTestCase) + if __name__ == '__main__': test_main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2009-05-05 21:12:50
|
Revision: 6300 http://jython.svn.sourceforge.net/jython/?rev=6300&view=rev Author: otmarhumbel Date: 2009-05-05 21:12:43 +0000 (Tue, 05 May 2009) Log Message: ----------- add profile.txt to svn:ignore Property Changed: ---------------- trunk/jython/ Property changes on: trunk/jython ___________________________________________________________________ Modified: svn:ignore - .externalToolBuilders .classpath .project *.ipr *.iws *.iml build dist ant.properties bin cachedir .settings + .externalToolBuilders .classpath .project *.ipr *.iws *.iml build dist ant.properties bin cachedir .settings profile.txt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2009-05-05 21:02:58
|
Revision: 6299 http://jython.svn.sourceforge.net/jython/?rev=6299&view=rev Author: otmarhumbel Date: 2009-05-05 21:02:49 +0000 (Tue, 05 May 2009) Log Message: ----------- properly decode the URL, making these tests pass in hudson's jython all workspace Modified Paths: -------------- trunk/jython/tests/java/org/python/core/PySystemState_registry_Test.java Modified: trunk/jython/tests/java/org/python/core/PySystemState_registry_Test.java =================================================================== --- trunk/jython/tests/java/org/python/core/PySystemState_registry_Test.java 2009-05-05 19:28:24 UTC (rev 6298) +++ trunk/jython/tests/java/org/python/core/PySystemState_registry_Test.java 2009-05-05 21:02:49 UTC (rev 6299) @@ -6,6 +6,7 @@ import java.io.IOException; import java.lang.reflect.Field; import java.net.URL; +import java.net.URLDecoder; import java.util.Properties; import junit.framework.TestCase; @@ -161,13 +162,14 @@ /** * determine the installation root (the /dist directory) + * @throws Exception */ - private void findRoot() { + private void findRoot() throws Exception { Class<? extends PySystemState_registry_Test> thisClass = getClass(); String classFileName = "/".concat(thisClass.getName().replace('.', '/')).concat(".class"); URL url = thisClass.getResource(classFileName); assertNotNull(url); - String path = url.getPath(); + String path = URLDecoder.decode(url.getPath(), "UTF-8"); assertTrue(path.endsWith(classFileName)); String classesDirName = path.substring(0, path.length() - classFileName.length()); File classesDir = new File(classesDirName); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <otm...@us...> - 2009-05-05 19:28:42
|
Revision: 6298 http://jython.svn.sourceforge.net/jython/?rev=6298&view=rev Author: otmarhumbel Date: 2009-05-05 19:28:24 +0000 (Tue, 05 May 2009) Log Message: ----------- fixed test-jython.sh, at least on OS X Modified Paths: -------------- trunk/jython/tests/shell/test-jython.sh Modified: trunk/jython/tests/shell/test-jython.sh =================================================================== --- trunk/jython/tests/shell/test-jython.sh 2009-05-05 07:20:51 UTC (rev 6297) +++ trunk/jython/tests/shell/test-jython.sh 2009-05-05 19:28:24 UTC (rev 6298) @@ -52,12 +52,12 @@ # $CLASSPATH CLASSPATH="$JYTHON_HOME/Lib/test/blob.jar" \ "$JYTHON" -c "print __import__('Blob')" | \ - [ `egrep -c "^Blob"` == 1 ] + [ `egrep -c "Blob"` == 1 ] # $CLASSPATH + profiling CLASSPATH="$JYTHON_HOME/Lib/test/blob.jar" \ "$JYTHON" --profile -c "print __import__('Blob')" | \ - [ `egrep -c "^Blob"` == 1 ] + [ `egrep -c "Blob"` == 1 ] set +ex done This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-05 07:21:05
|
Revision: 6297 http://jython.svn.sourceforge.net/jython/?rev=6297&view=rev Author: pjenvey Date: 2009-05-05 07:20:51 +0000 (Tue, 05 May 2009) Log Message: ----------- refactor filter{string,unicode} into filterBaseString Modified Paths: -------------- trunk/jython/src/org/python/core/__builtin__.java Modified: trunk/jython/src/org/python/core/__builtin__.java =================================================================== --- trunk/jython/src/org/python/core/__builtin__.java 2009-05-05 07:19:13 UTC (rev 6296) +++ trunk/jython/src/org/python/core/__builtin__.java 2009-05-05 07:20:51 UTC (rev 6297) @@ -548,13 +548,11 @@ public static PyObject filter(PyObject func, PyObject seq) { if (seq instanceof PyString) { - if (seq instanceof PyUnicode) { - return filterunicode(func, (PyUnicode)seq); - } - return filterstring(func, (PyString)seq); + return filterBaseString(func, (PyString)seq, + seq instanceof PyUnicode ? PyUnicode.TYPE : PyString.TYPE); } if (seq instanceof PyTuple) { - return filtertuple(func, (PyTuple)seq); + return filterTuple(func, (PyTuple)seq); } PyList list = new PyList(); @@ -571,8 +569,8 @@ return list; } - public static PyObject filterstring(PyObject func, PyString seq) { - if (func == Py.None && seq.getType() == PyString.TYPE) { + public static PyObject filterBaseString(PyObject func, PyBaseString seq, PyType stringType) { + if (func == Py.None && seq.getType() == stringType) { // If it's a real string we can return the original, as no character is ever // false and __getitem__ does return this character. If it's a subclass we // must go through the __getitem__ loop @@ -591,51 +589,24 @@ ok = true; } if (ok) { - if (!(item instanceof PyString) || item instanceof PyUnicode) { - throw Py.TypeError("can't filter str to str: __getitem__ returned different " - + "type"); + if (!Py.isInstance(item, stringType)) { + String name = stringType.fastGetName(); + throw Py.TypeError(String.format("can't filter %s to %s: __getitem__ returned " + + "different type", name, name)); } builder.append(item.toString()); } } - return new PyString(builder.toString()); - } - public static PyObject filterunicode(PyObject func, PyUnicode seq) { - if (func == Py.None && seq.getType() == PyUnicode.TYPE) { - // If it's a real string we can return the original, as no character is ever - // false and __getitem__ does return this character. If it's a subclass we - // must go through the __getitem__ loop - return seq; - } - - StringBuilder builder = new StringBuilder(); - boolean ok; - for (PyObject item : seq.asIterable()) { - ok = false; - if (func == Py.None) { - if (item.__nonzero__()) { - ok = true; - } - } else if (func.__call__(item).__nonzero__()) { - ok = true; - } - if (ok) { - if (!(item instanceof PyUnicode)) { - throw Py.TypeError("can't filter unicode to unicode: __getitem__ returned " - + "different type"); - } - builder.append(item.toString()); - } - } - return new PyUnicode(builder.toString()); + String result = builder.toString(); + return stringType == PyString.TYPE ? new PyString(result) : new PyUnicode(result); } - public static PyObject filtertuple(PyObject func, PyTuple seq) { - int len = seq.__len__(); + public static PyObject filterTuple(PyObject func, PyTuple seq) { + int len = seq.size(); if (len == 0) { if (seq.getType() != PyTuple.TYPE) { - seq = new PyTuple(); + return Py.EmptyTuple; } return seq; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-05 07:19:39
|
Revision: 6296 http://jython.svn.sourceforge.net/jython/?rev=6296&view=rev Author: pjenvey Date: 2009-05-05 07:19:13 +0000 (Tue, 05 May 2009) Log Message: ----------- avoid overwriting any ProcessBuilder env vars unless it's necessary. it inherits them from Sysem.getenv and will maintain their underlying byte values (which may be butchered as Strings) on UNIX platforms if we don't touch them Modified Paths: -------------- trunk/jython/Lib/subprocess.py Modified: trunk/jython/Lib/subprocess.py =================================================================== --- trunk/jython/Lib/subprocess.py 2009-05-05 01:31:30 UTC (rev 6295) +++ trunk/jython/Lib/subprocess.py 2009-05-05 07:19:13 UTC (rev 6296) @@ -1132,6 +1132,30 @@ return CouplerThread(*args, **kwargs) + def _setup_env(self, env, builder_env): + """Carefully merge env with ProcessBuilder's only + overwriting key/values that differ + + System.getenv (Map<String, String>) may be backed by + <byte[], byte[]> on UNIX platforms where these are really + bytes. ProcessBuilder's env inherits its contents and will + maintain those byte values (which may be butchered as + Strings) for the subprocess if they haven't been modified. + """ + # Determine what's safe to merge + merge_env = dict((key, value) for key, value in env.iteritems() + if key not in builder_env or + builder_env.get(key) != value) + + # Prune anything not in env + entries = builder_env.entrySet().iterator() + for entry in entries: + if entry.getKey() not in env: + entries.remove() + + builder_env.putAll(merge_env) + + def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, @@ -1163,16 +1187,10 @@ except java.lang.IllegalArgumentException, iae: raise OSError(iae.getMessage() or iae) - if env is None: - # For compatibility with CPython which calls - # os.execvp(). os.environ is "inherited" there if env is - # not explicitly set - env = os.environ + # os.environ may be inherited for compatibility with CPython + self._setup_env(dict(os.environ if env is None else env), + builder.environment()) - builder_env = builder.environment() - builder_env.clear() - builder_env.putAll(dict(env)) - if cwd is None: cwd = os.getcwd() elif not os.path.exists(cwd): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2009-05-05 02:14:42
|
Revision: 6295 http://jython.svn.sourceforge.net/jython/?rev=6295&view=rev Author: pjenvey Date: 2009-05-05 01:31:30 +0000 (Tue, 05 May 2009) Log Message: ----------- small cleanup Modified Paths: -------------- trunk/jython/Lib/subprocess.py trunk/jython/Lib/test/test_subprocess_jy.py Modified: trunk/jython/Lib/subprocess.py =================================================================== --- trunk/jython/Lib/subprocess.py 2009-05-04 12:09:44 UTC (rev 6294) +++ trunk/jython/Lib/subprocess.py 2009-05-05 01:31:30 UTC (rev 6295) @@ -1107,8 +1107,8 @@ pass elif stderr == PIPE: errread = PIPE - elif stderr == STDOUT or \ - isinstance(stderr, org.python.core.io.RawIOBase): + elif (stderr == STDOUT or + isinstance(stderr, org.python.core.io.RawIOBase)): errwrite = stderr else: # Assuming file-like object @@ -1123,8 +1123,8 @@ """Determine if the subprocess' stderr should be redirected to stdout """ - return errwrite == STDOUT or c2pwrite not in (None, PIPE) and \ - c2pwrite is errwrite + return (errwrite == STDOUT or c2pwrite not in (None, PIPE) and + c2pwrite is errwrite) def _coupler_thread(self, *args, **kwargs): @@ -1164,9 +1164,9 @@ raise OSError(iae.getMessage() or iae) if env is None: - # This is for compatibility with the CPython implementation, - # that ends up calling os.execvp(). So os.environ is "inherited" - # there if env is not explicitly set. + # For compatibility with CPython which calls + # os.execvp(). os.environ is "inherited" there if env is + # not explicitly set env = os.environ builder_env = builder.environment() @@ -1563,9 +1563,9 @@ # print "Running a jython subprocess to return the number of processors..." p = Popen([sys.executable, "-c", - 'import sys;' \ - 'from java.lang import Runtime;' \ - 'sys.exit(Runtime.getRuntime().availableProcessors())']) + ('import sys;' + 'from java.lang import Runtime;' + 'sys.exit(Runtime.getRuntime().availableProcessors())')]) print p.wait() # @@ -1573,15 +1573,15 @@ # print "Connecting two jython subprocesses..." p1 = Popen([sys.executable, "-c", - 'import os;' \ - 'print os.environ["foo"]'], env=dict(foo='bar'), + ('import os;' + 'print os.environ["foo"]')], env=dict(foo='bar'), stdout=PIPE) p2 = Popen([sys.executable, "-c", - 'import os, sys;' \ - 'their_foo = sys.stdin.read().strip();' \ - 'my_foo = os.environ["foo"];' \ - 'msg = "Their env\'s foo: %r, My env\'s foo: %r";' \ - 'print msg % (their_foo, my_foo)'], + ('import os, sys;' + 'their_foo = sys.stdin.read().strip();' + 'my_foo = os.environ["foo"];' + 'msg = "Their env\'s foo: %r, My env\'s foo: %r";' + 'print msg % (their_foo, my_foo)')], env=dict(foo='baz'), stdin=p1.stdout, stdout=PIPE) print p2.communicate()[0] Modified: trunk/jython/Lib/test/test_subprocess_jy.py =================================================================== --- trunk/jython/Lib/test/test_subprocess_jy.py 2009-05-04 12:09:44 UTC (rev 6294) +++ trunk/jython/Lib/test/test_subprocess_jy.py 2009-05-05 01:31:30 UTC (rev 6295) @@ -1,4 +1,4 @@ -"Tests for cmp() compatibility with CPython" +"""Misc subprocess tests""" import unittest import os import sys @@ -6,6 +6,7 @@ from subprocess import Popen, PIPE class EnvironmentInheritanceTest(unittest.TestCase): + def testDefaultEnvIsInherited(self): # Test for issue #1104 os.environ['foo'] = 'something' @@ -15,8 +16,12 @@ self.assertEquals('something', p1.stdout.read()) -# tests for (some parts of) issue #1187: JYTHON_OPTS should not be enriched by arguments class JythonOptsTest(unittest.TestCase): + + """ Tests for (some parts of) issue #1187: JYTHON_OPTS should not be + enriched by arguments + """ + def testNoJythonOpts(self): os.environ['JYTHON_OPTS'] = '' p1 = Popen([sys.executable, "-c", @@ -32,12 +37,11 @@ stdout=PIPE) self.assertEquals(options, p1.stdout.read()) + def test_main(): - test_classes = ( - EnvironmentInheritanceTest, - JythonOptsTest, - ) - test_support.run_unittest(*test_classes) + test_support.run_unittest(EnvironmentInheritanceTest, + JythonOptsTest) + if __name__ == '__main__': test_main() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |