File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,15 @@ def get_version(rel_path):
2626# Temp fix for CoppeliaSim 4.1
2727if 'COPPELIASIM_ROOT' not in os .environ :
2828 raise RuntimeError ('COPPELIASIM_ROOT not defined.' )
29- with open (os .path .join (os .environ ['COPPELIASIM_ROOT' ], 'system' , 'usrset.txt' ), 'r' ) as f :
30- usrset = f .read ()
29+
30+ usrset_file = os .path .join (os .environ ['COPPELIASIM_ROOT' ], 'system' , 'usrset.txt' )
31+ usrset = ''
32+ if os .path .isfile (usrset_file ):
33+ with open (usrset_file , 'r' ) as f :
34+ usrset = f .read ()
3135
3236if 'allowOldEduRelease' not in usrset :
33- with open (os . path . join ( os . environ [ 'COPPELIASIM_ROOT' ] , 'system' , 'usrset.txt' ), 'a ' ) as f :
37+ with open (usrset_file , 'a+ ' ) as f :
3438 f .write ('\n allowOldEduRelease=7501\n ' )
3539
3640
You can’t perform that action at this time.
0 commit comments