Skip to content

Commit

Permalink
Fix usrset file check during install.
Browse files Browse the repository at this point in the history
  • Loading branch information
stepjam committed Jul 19, 2021
1 parent 62741c8 commit 9bcf2c1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ def get_version(rel_path):
# Temp fix for CoppeliaSim 4.1
if 'COPPELIASIM_ROOT' not in os.environ:
raise RuntimeError('COPPELIASIM_ROOT not defined.')
with open(os.path.join(os.environ['COPPELIASIM_ROOT'], 'system', 'usrset.txt'), 'r') as f:
usrset = f.read()

usrset_file = os.path.join(os.environ['COPPELIASIM_ROOT'], 'system', 'usrset.txt')
usrset = ''
if os.path.isfile(usrset_file):
with open(usrset_file, 'r') as f:
usrset = f.read()

if 'allowOldEduRelease' not in usrset:
with open(os.path.join(os.environ['COPPELIASIM_ROOT'], 'system', 'usrset.txt'), 'a') as f:
with open(usrset_file, 'a+') as f:
f.write('\nallowOldEduRelease=7501\n')


Expand Down

0 comments on commit 9bcf2c1

Please sign in to comment.