From 1cb78f1cc4f9695caa482353b79c499e11db765a Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Mon, 18 Mar 2013 02:18:50 +0000 Subject: [PATCH] Fixed bad interaction of setup.py with other dependencies The problem is in Distribute dependencies on Python 3. Create a new command class instead of changing inplace the one other projects may use. Close ticket #153. --- NEWS | 2 ++ setup.py | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index e8409285..bbba1c32 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ What's new in psycopg 2.4.7 --------------------------- - Properly cleanup memory of broken connections (ticket #142). + - Fixed bad interaction of setup.py with other dependencies in + Distribute project on Python 3 (ticket #153). What's new in psycopg 2.4.6 diff --git a/setup.py b/setup.py index 923e3cd8..33099c21 100644 --- a/setup.py +++ b/setup.py @@ -55,14 +55,18 @@ from distutils.ccompiler import get_default_compiler from distutils.util import get_platform try: - from distutils.command.build_py import build_py_2to3 as build_py + from distutils.command.build_py import build_py_2to3 except ImportError: from distutils.command.build_py import build_py else: + class build_py(build_py_2to3): + # workaround subclass for ticket #153 + pass + # Configure distutils to run our custom 2to3 fixers as well from lib2to3.refactor import get_fixers_from_package - build_py.fixer_names = get_fixers_from_package('lib2to3.fixes') - build_py.fixer_names.append('fix_b') + build_py.fixer_names = get_fixers_from_package('lib2to3.fixes') \ + + [ 'fix_b' ] sys.path.insert(0, 'scripts') try: