From 6d47246d97d50010f899be22baac00634a20be2d Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 30 Dec 2008 12:34:58 +0100 Subject: [PATCH] fix doctest --- tests/run/locals.pyx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) 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 -- 2.26.2