Handle undefined __file__
Needed for running non-interactively. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
parent
7024eb6fae
commit
345ff9ca7e
@ -47,7 +47,11 @@ is_packaged = False
|
|||||||
if is_packaged:
|
if is_packaged:
|
||||||
vagfile='/usr/share/scullery/{}'.format(vagfile)
|
vagfile='/usr/share/scullery/{}'.format(vagfile)
|
||||||
else:
|
else:
|
||||||
vagfile='{}/{}'.format(os.path.abspath(os.path.dirname(__file__)), vagfile)
|
try:
|
||||||
|
me = __file__
|
||||||
|
except NameError:
|
||||||
|
me = sys.argv[0]
|
||||||
|
vagfile='{}/{}'.format(os.path.abspath(os.path.dirname(me)), vagfile)
|
||||||
|
|
||||||
def _abort(msg):
|
def _abort(msg):
|
||||||
log.error(msg)
|
log.error(msg)
|
||||||
|
Loading…
Reference in New Issue
Block a user