diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-02-25 16:22:22 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-02-25 16:22:22 +0900 |
commit | 15d0a905b2203ca2b58e278f46f1de948c258dc3 (patch) | |
tree | 0a947be7826ed3c9c66838b9a725cf877efca68a /buildstream/_profile.py | |
parent | 3ce26149d42dd955240c4638449ba88ff8d94b09 (diff) | |
download | buildstream-15d0a905b2203ca2b58e278f46f1de948c258dc3.tar.gz |
_profile.py: Fixed to only initialize once
Diffstat (limited to 'buildstream/_profile.py')
-rw-r--r-- | buildstream/_profile.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/buildstream/_profile.py b/buildstream/_profile.py index a484362d4..a18cdfe5f 100644 --- a/buildstream/_profile.py +++ b/buildstream/_profile.py @@ -119,13 +119,14 @@ def profile_end(topic, key): def profile_init(): - if initialized: - return - setting = os.getenv('BST_PROFILE') - if setting: - topics = setting.split(':') - for topic in topics: - active_topics[topic] = True + global initialized + if not initialized: + setting = os.getenv('BST_PROFILE') + if setting: + topics = setting.split(':') + for topic in topics: + active_topics[topic] = True + initialized = True def profile_enabled(topic): |