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
(74a719b117)

This change places the fix from Icd412ca8435dca4b0f3b4075eca39b903dde6d27
in the right location to be synced into the other repositories.

Change-Id: I7560e474e68bf361f3af61bdfc8e2dbc9e2413f1
This commit is contained in:
Doug Hellmann 2014-04-21 09:43:40 -07:00
parent 32aa583e4d
commit 9cbc56ef37
1 changed files with 8 additions and 0 deletions

View File

@ -53,6 +53,14 @@ _setup_py_text = """#!/usr/bin/env python
# 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 # noqa
except ImportError:
pass
setuptools.setup(
setup_requires=['pbr'],
pbr=True)