Commits

Armin Rigo committed 95c7ec0

Fix _curses to not use unicode names when creating attributes.

Fix translation to work anyway in this case (because pypy 2.0-beta2 has such
attributes).

  • Participants
  • Parent commits 0126d66

Comments (0)

Files changed (3)

File lib_pypy/_curses.py

             key_n = ffi.string(key_n)
             if key_n == b"UNKNOWN KEY":
                 continue
-            key_n = key_n.decode().replace('(', '').replace(')', '')
+            if not isinstance(key_n, str):   # python 3
+                key_n = key_n.decode()
+            key_n = key_n.replace('(', '').replace(')', '')
             globals()[key_n] = key
 
 _setup()

File pypy/interpreter/baseobjspace.py

 
     def new_interned_w_str(self, w_s):
         s = self.str_w(w_s)
+        assert isinstance(s, str)
         try:
             return self.interned_strings[s]
         except KeyError:
         return w_s
 
     def new_interned_str(self, s):
+        assert isinstance(s, str)
         try:
             return self.interned_strings[s]
         except KeyError:

File pypy/module/_minimal_curses/__init__.py

     }
 
 for i in dir(_curses):
+    i = str(i)     # workaround for pypy 2.0-beta2
     val = getattr(_curses, i)
     if i.isupper() and type(val) is int:
         Module.interpleveldefs[i] = "space.wrap(%s)" % val