Fix open empty file

This commit is contained in:
Ian Jauslin 2024-02-24 10:44:11 -05:00
parent 121b8fe4b0
commit a152af6bac

View File

@ -61,10 +61,10 @@ def read_cli():
else: else:
openfile=arg openfile=arg
(ret,message)=filecheck.check_edit(openfile) (ret,message)=filecheck.check_edit(openfile)
preread_conf(openfile)
if ret<0: if ret<0:
print(message,file=sys.stderr) print(message,file=sys.stderr)
exit(-1) exit(-1)
preread_conf(openfile)
# read command line arguments from configuration file # read command line arguments from configuration file
def preread_conf(file): def preread_conf(file):
@ -72,8 +72,7 @@ def preread_conf(file):
try: try:
ff=open(file,"r") ff=open(file,"r")
except: except:
print("error: could not read file '"+file+"' (this should not happen and is probably a bug)", file=sys.stderr) return
exit(-1)
# counter # counter
i=0 i=0