]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
py:colour: colour_if_wanted() returns the result
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Fri, 9 Sep 2022 02:35:12 +0000 (14:35 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 16 Sep 2022 05:46:36 +0000 (05:46 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/colour.py

index 448b456b4656c7e4e10d4b5155e8af436b72fb50..407930a8f34078f278f6a7e89386b32cdf3f37f8 100644 (file)
@@ -122,7 +122,9 @@ def is_colour_wanted(stream, hint='auto'):
 
 
 def colour_if_wanted(stream, hint='auto'):
-    if is_colour_wanted(stream, hint):
+    wanted = is_colour_wanted(stream, hint)
+    if wanted:
         switch_colour_on()
     else:
         switch_colour_off()
+    return wanted