From 15d0a905b2203ca2b58e278f46f1de948c258dc3 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Sat, 25 Feb 2017 16:22:22 +0900 Subject: _profile.py: Fixed to only initialize once --- buildstream/_profile.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'buildstream/_profile.py') 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): -- cgit v1.2.1