py3: Fix a couple of env var checks

This commit is contained in:
Kovid Goyal 2019-04-17 08:19:01 +05:30
parent dd328bdb8c
commit 5623d8c7f4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 3 additions and 3 deletions

View File

@ -198,7 +198,7 @@ def sanitize_path():
sw
).split() + needed_paths
os.environ['PATH'] = os.pathsep.join(paths)
print('PATH:', os.environ[b'PATH'])
print('PATH:', os.environ['PATH'])
def vcenv():

View File

@ -172,7 +172,7 @@ option_parser = create_option_parser
def ensure_single_instance():
if b'CALIBRE_NO_SI_DANGER_DANGER' not in os.environ and not singleinstance('db'):
if 'CALIBRE_NO_SI_DANGER_DANGER' not in os.environ and not singleinstance('db'):
ext = '.exe' if iswindows else ''
raise SystemExit(
_(

View File

@ -74,7 +74,7 @@ def check_allowed():
raise NotAllowed('Not allowed to create associations for portable installs')
if sys.getwindowsversion()[:2] < (6, 2):
raise NotAllowed('Not allowed to create associations for windows versions older than Windows 8')
if b'CALIBRE_NO_DEFAULT_PROGRAMS' in os.environ:
if 'CALIBRE_NO_DEFAULT_PROGRAMS' in os.environ:
raise NotAllowed('Disabled by the CALIBRE_NO_DEFAULT_PROGRAMS environment variable')