mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: Fix a couple of env var checks
This commit is contained in:
parent
dd328bdb8c
commit
5623d8c7f4
@ -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():
|
||||
|
@ -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(
|
||||
_(
|
||||
|
@ -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')
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user