[Jython-checkins] jython: Fixes type of time.strptime as per issue #1964 part 2.
jeff.allen
jython-checkins at python.org
Sat Jan 25 23:56:24 CET 2014
http://hg.python.org/jython/rev/57232db660c9
changeset: 7179:57232db660c9
user: Santoso Wijaya <santoso.wijaya at gmail.com>
date: Sat Jan 25 20:05:48 2014 +0000
summary:
Fixes type of time.strptime as per issue #1964 part 2.
Fallback to python from native code used the wrong function, revealed
by original %f fix.
files:
Lib/test/test_strptime_jy.py | 2 +-
src/org/python/modules/time/Time.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_strptime_jy.py b/Lib/test/test_strptime_jy.py
--- a/Lib/test/test_strptime_jy.py
+++ b/Lib/test/test_strptime_jy.py
@@ -20,7 +20,7 @@
def test_issue1964(self):
d = strptime('0', '%f')
- self.assertEqual(0, d[1])
+ self.assertEqual(1900, d.tm_year)
def test_main():
test_support.run_unittest(
diff --git a/src/org/python/modules/time/Time.java b/src/org/python/modules/time/Time.java
--- a/src/org/python/modules/time/Time.java
+++ b/src/org/python/modules/time/Time.java
@@ -688,7 +688,7 @@
*/
private static PyTuple pystrptime(String data_string, String format) {
return (PyTuple) __builtin__.__import__("_strptime")
- .invoke("_strptime",
+ .invoke("_strptime_time",
Py.newUnicode(data_string),
Py.newUnicode(format));
}
--
Repository URL: http://hg.python.org/jython
More information about the Jython-checkins
mailing list