[Jython-checkins] jython: Fixed mro-issue caused by last commit. This caused e.g. test_descrtut to fail.
stefan.richthofer
jython-checkins at python.org
Wed Oct 21 22:34:48 EDT 2015
https://hg.python.org/jython/rev/052ff7210e62
changeset: 7763:052ff7210e62
user: Stefan Richthofer <stefan.richthofer at gmx.de>
date: Thu Oct 22 04:34:38 2015 +0200
summary:
Fixed mro-issue caused by last commit. This caused e.g. test_descrtut to fail.
files:
src/org/python/core/PyDictionary.java | 2 +-
src/org/python/core/PyDictionaryDerived.java | 3 ++-
src/org/python/core/PyStringMap.java | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/org/python/core/PyDictionary.java b/src/org/python/core/PyDictionary.java
--- a/src/org/python/core/PyDictionary.java
+++ b/src/org/python/core/PyDictionary.java
@@ -26,7 +26,7 @@
/**
* A builtin python dictionary.
*/
- at ExposedType(name = "dict", doc = BuiltinDocs.dict_doc)
+ at ExposedType(name = "dict", base = PyObject.class, doc = BuiltinDocs.dict_doc)
public class PyDictionary extends AbstractDict implements ConcurrentMap, Traverseproc {
public static final PyType TYPE = PyType.fromClass(PyDictionary.class);
diff --git a/src/org/python/core/PyDictionaryDerived.java b/src/org/python/core/PyDictionaryDerived.java
--- a/src/org/python/core/PyDictionaryDerived.java
+++ b/src/org/python/core/PyDictionaryDerived.java
@@ -100,8 +100,9 @@
PyObject impl=self_type.lookup("__str__");
if (impl!=null) {
PyObject res=impl.__get__(this,self_type).__call__();
- if (res instanceof PyString)
+ if (res instanceof PyString) {
return(PyString)res;
+ }
throw Py.TypeError("__str__"+" returned non-"+"string"+" (type "+res.getType().fastGetName()+")");
}
return super.__str__();
diff --git a/src/org/python/core/PyStringMap.java b/src/org/python/core/PyStringMap.java
--- a/src/org/python/core/PyStringMap.java
+++ b/src/org/python/core/PyStringMap.java
@@ -23,7 +23,7 @@
* Special fast dict implementation for __dict__ instances. Allows interned String keys in addition
* to PyObject unlike PyDictionary.
*/
- at ExposedType(name = "stringmap", isBaseType = false)
+ at ExposedType(name = "stringmap", base = PyObject.class, isBaseType = false)
public class PyStringMap extends AbstractDict implements Traverseproc {
/**
--
Repository URL: https://hg.python.org/jython
More information about the Jython-checkins
mailing list