Skip to content

Commit 811b43d

Browse files
authored
Merge pull request #81 from chrisjbillington/py36-path-bug
Fix bug on Python3.6
2 parents b8726ad + a3be0db commit 811b43d

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)