Skip to content

Commit cb73782

Browse files
committed
Merge branch 'release/3.53.3'
2 parents 6717b31 + 8a96eef commit cb73782

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

progressbar/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
long running operations.
2020
'''.strip().split())
2121
__email__ = '[email protected]'
22-
__version__ = '3.53.2'
22+
__version__ = '3.53.3'
2323
__license__ = 'BSD'
2424
__copyright__ = 'Copyright 2015 Rick van Hattem (Wolph)'
2525
__url__ = 'https://github.com/WoLpH/python-progressbar'

progressbar/utils.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from __future__ import absolute_import
2-
import distutils.util
32
import atexit
43
import io
54
import os
@@ -173,13 +172,15 @@ def env_flag(name, default=None):
173172
Accepts environt variables formatted as y/n, yes/no, 1/0, true/false,
174173
on/off, and returns it as a boolean
175174
176-
If the environt variable is not defined, or has an unknown value, returns
177-
`default`
175+
If the environment variable is not defined, or has an unknown value,
176+
returns `default`
178177
'''
179-
try:
180-
return bool(distutils.util.strtobool(os.environ.get(name, '')))
181-
except ValueError:
182-
return default
178+
v = os.getenv(name)
179+
if v and v.lower() in ('y', 'yes', 't', 'true', 'on', '1'):
180+
return True
181+
if v and v.lower() in ('n', 'no', 'f', 'false', 'off', '0'):
182+
return False
183+
return default
183184

184185

185186
class WrappingIO:

0 commit comments

Comments
 (0)