From: Robert Bradshaw Date: Thu, 26 Feb 2009 05:13:06 +0000 (-0800) Subject: Test for typed from...import X-Git-Tag: 0.11.rc~36^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dea87f8a201ac6fe27a069fdb2bece988be14126;p=cython.git Test for typed from...import --- diff --git a/tests/run/importfrom.pyx b/tests/run/importfrom.pyx index e7dbd6d5..65514607 100644 --- a/tests/run/importfrom.pyx +++ b/tests/run/importfrom.pyx @@ -8,6 +8,11 @@ True True >>> import4() == (cmd, core, version) True +>>> typed_imports() +True +True +an integer is required +Expected tuple, got int """ def import1(): @@ -37,3 +42,27 @@ def import3(): def import4(): from distutils import cmd, core, version return cmd, core, version + + + +def typed_imports(): + + import sys + cdef long maxint + cdef tuple t + + from sys import maxint + print maxint == sys.maxint + from sys import version_info as t + print t is sys.version_info + + try: + from sys import version_info as maxint + except TypeError, e: + print e + + try: + from sys import maxint as t + except TypeError, e: + print e +