Skip to content

Commit a3be0db

Browse files
Fix bug on Python3.6, where Path object not able to be treated as a
string in ConfigParser.
1 parent e13c992 commit a3be0db

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

labscript_profile/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ def add_userlib_and_pythonlib():
4949
time the interpreter starts up"""
5050
labconfig = default_labconfig_path()
5151
if labconfig is not None and labconfig.exists():
52-
config = ConfigParser(defaults={'labscript_suite': LABSCRIPT_SUITE_PROFILE})
52+
# str() below is for py36 compat, where ConfigParser can't deal with Path objs
53+
config = ConfigParser(
54+
defaults={'labscript_suite': str(LABSCRIPT_SUITE_PROFILE)}
55+
)
5356
config.read(labconfig)
5457
for option in ['userlib', 'pythonlib']:
5558
try:

labscript_utils/labconfig.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def __init__(
4343
required_params = {}
4444
if defaults is None:
4545
defaults = {}
46-
defaults['labscript_suite'] = LABSCRIPT_SUITE_PROFILE
46+
# str() below is for py36 compat, where ConfigParser can't deal with Path objs
47+
defaults['labscript_suite'] = str(LABSCRIPT_SUITE_PROFILE)
4748
if isinstance(config_path, list):
4849
self.config_path = config_path[0]
4950
else:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy