Message2069

Author tristanlk
Recipients
Date 2008-02-08.04:23:31
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
>>> class Test(unicode):
...     pass
...
>>> a = Test('{1:1}')
>>> a == {1:1}
Traceback (innermost last):
  File "<console>", line 1, in ?
TypeError: unicode.__cmp__(x,y) requires y to be 'unicode', not a 'dict'

should return False.

i fixed this with the following patch: but i think it may be more of a work around than a fix.

Index: src/org/python/core/PyObject.java
===================================================================
--- src/org/python/core/PyObject.java   (revision 4112)
+++ src/org/python/core/PyObject.java   (working copy)
@@ -1253,7 +1253,7 @@
                 return res;
             return _cmpeq_unsafe(o) == 0 ? Py.True : Py.False;
         } catch (PyException e) {
-            if (Py.matchException(e, Py.AttributeError)) {
+            if (Py.matchException(e, Py.AttributeError) || Py.matchException(e, Py.TypeError)) {
                 return Py.False;
             }
             throw e;
History
Date User Action Args
2008-02-20 17:18:10adminlinkissue1889394 messages
2008-02-20 17:18:10admincreate