Commits

Frank Wierzbicki committed 6ca8838

Revert allowing unicode in names.

  • Participants
  • Parent commits 32cee9b
  • Branches 2.5

Comments (0)

Files changed (2)

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

     }
 
     public static PyObject classobj___new__(PyObject name, PyObject bases, PyObject dict) {
-        if (!name.getType().isSubType(PyBaseString.TYPE)) {
+        if (!name.getType().isSubType(PyString.TYPE)) {
             throw Py.TypeError("PyClass_New: name must be a string");
         }
         if (!(dict instanceof PyStringMap || dict instanceof PyDictionary)) {
     }
 
     public void setName(PyObject value) {
-        if (value == null || !Py.isInstance(value, PyBaseString.TYPE)) {
+        if (value == null || !Py.isInstance(value, PyString.TYPE)) {
             throw Py.TypeError("__name__ must be a string object");
         }
         String name = value.toString();

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

             throw Py.TypeError("function() argument 1 must be code, not " +
                                code.getType().fastGetName());
         }
-        if (name != Py.None && !Py.isInstance(name, PyBaseString.TYPE)) {
+        if (name != Py.None && !Py.isInstance(name, PyString.TYPE)) {
             throw Py.TypeError("arg 3 (name) must be None or string");
         }
         if (defaults != Py.None && !(defaults instanceof PyTuple)) {