From c6d30536dc643fb5cf5ffa5d095640c80af4d153 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Mon, 31 Mar 2014 13:48:43 -0700 Subject: [PATCH] Work around atexit bug in python < 2.7.4 In python < 2.7.4, a lazy loading of package `pbr` will break setuptools if some other modules registered functions in `atexit`. solution from: http://bugs.python.org/issue15881#msg170215 This problem originally appeared in stevedore before the library was adopted by Oslo (https://github.com/dreamhost/stevedore/commit/74a719b11781cc93d60cff1b0a01de3e4e780a1d) Change-Id: Icd412ca8435dca4b0f3b4075eca39b903dde6d27 --- setup.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup.py b/setup.py index 70c2b3f32b..83f2a7a646 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,14 @@ # THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT import setuptools +# In python < 2.7.4, a lazy loading of package `pbr` will break +# setuptools if some other modules registered functions in `atexit`. +# solution from: http://bugs.python.org/issue15881#msg170215 +try: + import multiprocessing # flake8: noqa +except ImportError: + pass + setuptools.setup( setup_requires=['pbr'], pbr=True)