Commit b0511036 authored by Stefan Behnel's avatar Stefan Behnel

Py3 test fixes

parent d1d79cda
...@@ -12,10 +12,10 @@ def test(): ...@@ -12,10 +12,10 @@ def test():
cdef long neg = -1 cdef long neg = -1
cdef unsigned long pos = -2 # will be a large positive number cdef unsigned long pos = -2 # will be a large positive number
print "neg", neg > 0 print u"neg", neg > 0
print "pos", pos > 0 print u"pos", pos > 0
D = { neg: 'neg', pos: 'pos' } D = { neg: u'neg', pos: u'pos' }
print D[<object>neg] print D[<object>neg]
print D[<object>pos] print D[<object>pos]
......
...@@ -6,9 +6,14 @@ __doc__ = u""" ...@@ -6,9 +6,14 @@ __doc__ = u"""
>>> modint(9,2) >>> modint(9,2)
1 1
"""
import sys
if sys.version_info[0] < 3:
__doc__ = __doc__ + u"""
>>> print modptr() >>> modptr()
spameggs 'spameggs'
""" """
def modobj(obj2, obj3): def modobj(obj2, obj3):
...@@ -25,5 +30,5 @@ def modptr(): ...@@ -25,5 +30,5 @@ def modptr():
str2 = "spam%s" str2 = "spam%s"
str3 = "eggs" str3 = "eggs"
obj1 = str2 % str3 obj1 = str2 % str3 # '%' operator doesn't work on byte strings in Py3
return obj1.decode(u"ASCII") return obj1
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment