From cd8428e969cd50e2f78ef0e9f4d262352450b652 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 24 Apr 2009 13:38:19 +0200 Subject: [PATCH] Py3: fix import of Cython.Compiler.Version in setup.py --- Cython/Shadow.py | 7 +++++-- Cython/__init__.py | 2 +- setup.py | 5 +---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cython/Shadow.py b/Cython/Shadow.py index 2b81aec1..17d781e0 100644 --- a/Cython/Shadow.py +++ b/Cython/Shadow.py @@ -150,9 +150,12 @@ class typedef(CythonType): -py_int = int -py_long = long py_float = float +py_int = int +try: + py_long = long +except NameError: # Py3 + py_long = int # Predefined types diff --git a/Cython/__init__.py b/Cython/__init__.py index 5ef285c0..f9f635d1 100644 --- a/Cython/__init__.py +++ b/Cython/__init__.py @@ -1,2 +1,2 @@ # Void cython.* directives (for case insensitive operating systems). -from Shadow import * +from Cython.Shadow import * diff --git a/setup.py b/setup.py index 93aa07eb..a78af98a 100644 --- a/setup.py +++ b/setup.py @@ -2,10 +2,7 @@ from distutils.core import setup, Extension from distutils.sysconfig import get_python_lib import os, os.path import sys -try: - from Cython.Compiler.Version import version -except ImportError: - version = None +from Cython.Compiler.Version import version compiler_dir = os.path.join(get_python_lib(prefix=''), 'Cython/Compiler') if sys.platform == "win32": -- 2.26.2