Skip to content

Commit

Permalink
exits with 255 when files not found
Browse files Browse the repository at this point in the history
  • Loading branch information
pmendes committed May 17, 2024
1 parent c087daf commit cda62a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sbmodelr
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ def read_network(network_file):
netf = f.read()
except FileNotFoundError:
print(f'ERROR: file {network_file} not found')
exit()
exit(-1)
# create list for links
ll = []
# check if this is a digraph
if( re.search(r'digraph\s*.*{', netf) ):
ll.append((0,0))
# check for the odd case of /* and */ appearing inside separate quotes and refuse to parse
if( re.search(r'"[\s\S]*?\/\*[\s\S]*\*\/[\s\S]*?"', netf) ):
print(fr'{network_file} contains identifiers with \* and *\, and cannot be parsed')
print(fr' Warning: {network_file} contains identifiers with \* and *\, and cannot be parsed')
return []
# remove comments
netf = re.sub(r'\s*//.*', '', netf) # // comments
Expand Down Expand Up @@ -417,7 +417,7 @@ if( args.network ):
seedmodel = load_model(seedmodelfile, remove_user_defined_functions=True)
if( seedmodel is None):
print(f'ERROR: {seedmodelfile} failed to load.\n')
exit()
exit(-1)

# print some information about the model
if( not args.quiet ):
Expand Down

0 comments on commit cda62a2

Please sign in to comment.