From 5623d8c7f465f10543b6dde28c71a2b0f24ad538 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 17 Apr 2019 08:19:01 +0530 Subject: [PATCH] py3: Fix a couple of env var checks --- setup/win-ci.py | 2 +- src/calibre/srv/standalone.py | 2 +- src/calibre/utils/winreg/default_programs.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup/win-ci.py b/setup/win-ci.py index 59bf4a1299..b4e17cb16b 100644 --- a/setup/win-ci.py +++ b/setup/win-ci.py @@ -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(): diff --git a/src/calibre/srv/standalone.py b/src/calibre/srv/standalone.py index da27be988e..6a73e48dd6 100644 --- a/src/calibre/srv/standalone.py +++ b/src/calibre/srv/standalone.py @@ -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( _( diff --git a/src/calibre/utils/winreg/default_programs.py b/src/calibre/utils/winreg/default_programs.py index 8cb073bbf4..00e20c9ef0 100644 --- a/src/calibre/utils/winreg/default_programs.py +++ b/src/calibre/utils/winreg/default_programs.py @@ -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')