From 0c7af76db771abec8fb4e8d10dc7b9cd7d3708b6 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Sat, 11 Dec 2010 02:10:14 -0800 Subject: [PATCH] Python 2.3 fix. --- Cython/Build/Dependencies.py | 6 +----- Cython/Build/Inline.py | 1 + Cython/Shadow.py | 14 +++++--------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/Cython/Build/Dependencies.py b/Cython/Build/Dependencies.py index 66046312..e4cd4fa8 100644 --- a/Cython/Build/Dependencies.py +++ b/Cython/Build/Dependencies.py @@ -1,11 +1,7 @@ from glob import glob import re, os, sys +from cython import set -try: - set -except NameError: - # Python 2.3 - from sets import Set as set from distutils.extension import Extension diff --git a/Cython/Build/Inline.py b/Cython/Build/Inline.py index 7295afa2..d5494e58 100644 --- a/Cython/Build/Inline.py +++ b/Cython/Build/Inline.py @@ -1,5 +1,6 @@ import tempfile import sys, os, re, inspect +from cython import set try: import hashlib diff --git a/Cython/Shadow.py b/Cython/Shadow.py index a4bbd206..0e22be6b 100644 --- a/Cython/Shadow.py +++ b/Cython/Shadow.py @@ -188,16 +188,12 @@ except NameError: # Py3 py_float = float py_complex = complex + try: - # Python 3 - from builtins import set, frozenset -except ImportError: - try: - # Python 2.4+ - from __builtin__ import set, frozenset - except ImportError: - # Py 2.3 - from sets import Set as set, ImmutableSet as frozenset + set +except NameError: + # Python 2.3 + from sets import Set as set, ImmutableSet as frozenset # Predefined types -- 2.26.2