Author: Philip Jenvey <pjen...@underboss.org>
Branch: py3k
Changeset: r74153:8c340acffe27
Date: 2014-10-24 00:44 -0700
http://bitbucket.org/pypy/pypy/changeset/8c340acffe27/

Log:    issue1899: fix broken bytes usage from default

diff --git a/lib_pypy/_tkinter/app.py b/lib_pypy/_tkinter/app.py
--- a/lib_pypy/_tkinter/app.py
+++ b/lib_pypy/_tkinter/app.py
@@ -439,7 +439,7 @@
         if isinstance(s, int):
             return s
         s = s.encode('utf-8')
-        if '\x00' in s:
+        if b'\x00' in s:
             raise TypeError
         v = tkffi.new("int*")
         res = tklib.Tcl_GetBoolean(self.interp, s, v)
@@ -451,7 +451,7 @@
         if isinstance(s, int):
             return s
         s = s.encode('utf-8')
-        if '\x00' in s:
+        if b'\x00' in s:
             raise TypeError
         v = tkffi.new("int*")
         res = tklib.Tcl_GetInt(self.interp, s, v)
@@ -463,7 +463,7 @@
         if isinstance(s, float):
             return s
         s = s.encode('utf-8')
-        if '\x00' in s:
+        if b'\x00' in s:
             raise TypeError
         v = tkffi.new("double*")
         res = tklib.Tcl_GetDouble(self.interp, s, v)
@@ -472,7 +472,7 @@
         return v[0]
 
     def exprboolean(self, s):
-        if '\x00' in s:
+        if b'\x00' in s:
             raise TypeError
         v = tkffi.new("int*")
         res = tklib.Tcl_ExprBoolean(self.interp, s, v)
@@ -481,7 +481,7 @@
         return v[0]
 
     def exprlong(self, s):
-        if '\x00' in s:
+        if b'\x00' in s:
             raise TypeError
         v = tkffi.new("long*")
         res = tklib.Tcl_ExprLong(self.interp, s, v)
@@ -490,7 +490,7 @@
         return v[0]
 
     def exprdouble(self, s):
-        if '\x00' in s:
+        if b'\x00' in s:
             raise TypeError
         v = tkffi.new("double*")
         res = tklib.Tcl_ExprDouble(self.interp, s, v)
@@ -499,7 +499,7 @@
         return v[0]
 
     def exprstring(self, s):
-        if '\x00' in s:
+        if b'\x00' in s:
             raise TypeError
         res = tklib.Tcl_ExprString(self.interp, s)
         if res == tklib.TCL_ERROR:
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to