From: Stefan Behnel Date: Tue, 30 Dec 2008 11:34:58 +0000 (+0100) Subject: fix doctest X-Git-Tag: 0.11-beta~64 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6d47246d97d50010f899be22baac00634a20be2d;p=cython.git fix doctest --- diff --git a/tests/run/locals.pyx b/tests/run/locals.pyx index c25480ac..e0ae907b 100644 --- a/tests/run/locals.pyx +++ b/tests/run/locals.pyx @@ -1,9 +1,20 @@ -__doc__ = """ -sage: get_locals(1,2,3) -{'args': (2, 3), 'kwds': {}, 'x': 1, 'y': 'hi', 'z': 5} +__doc__ = u""" +>>> sorted( get_locals(1,2,3, k=5) .items()) +[('args', (2, 3)), ('kwds', {'k': 5}), ('x', 1), ('y', 'hi'), ('z', 5)] """ +import sys +IS_PY3 = sys.version_info[0] >= 3 + def get_locals(x, *args, **kwds): - y = "hi" cdef int z = 5 + if IS_PY3: + y = u"hi" + else: + y = "hi" return locals() + +def sorted(it): + l = list(it) + l.sort() + return l