mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-27 14:25:16 +02:00
[config] softfail when config cannot be written
This commit is contained in:
parent
86457baeeb
commit
4ee3799773
1 changed files with 22 additions and 19 deletions
3
setup.py
3
setup.py
|
|
@ -176,6 +176,7 @@ home = os.getenv('HOME') or os.getenv('USERPROFILE')
|
||||||
user_file = os.path.join(home,'.config', 'GPy', 'user.cfg')
|
user_file = os.path.join(home,'.config', 'GPy', 'user.cfg')
|
||||||
|
|
||||||
print("")
|
print("")
|
||||||
|
try:
|
||||||
if not os.path.exists(user_file):
|
if not os.path.exists(user_file):
|
||||||
# Does an old config exist?
|
# Does an old config exist?
|
||||||
old_user_file = os.path.join(home,'.gpy_user.cfg')
|
old_user_file = os.path.join(home,'.gpy_user.cfg')
|
||||||
|
|
@ -196,3 +197,5 @@ if not os.path.exists(user_file):
|
||||||
f.write(tmp)
|
f.write(tmp)
|
||||||
else:
|
else:
|
||||||
print("GPy: User configuration file at location {}".format(user_file))
|
print("GPy: User configuration file at location {}".format(user_file))
|
||||||
|
except:
|
||||||
|
print("GPy: Could not write user configuration file {}".format(user_file))
|
||||||
Loading…
Add table
Add a link
Reference in a new issue