From 9cbc56ef377343aafd3b14ca16cf76ad7459b727 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Mon, 21 Apr 2014 09:43:40 -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) This change places the fix from Icd412ca8435dca4b0f3b4075eca39b903dde6d27 in the right location to be synced into the other repositories. Change-Id: I7560e474e68bf361f3af61bdfc8e2dbc9e2413f1 --- update.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/update.py b/update.py index 0cf9ef2e3f..5d27d297ed 100644 --- a/update.py +++ b/update.py @@ -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)