Do not fail if __main__ has not __file__ attribute

This happens when trytond is launched by a server like uwsgi.

issue10333
review334241002
This commit is contained in:
Cédric Krier
2021-04-24 19:24:27 +02:00
parent 7cd224905e
commit 1b40a6461d
+1 -1
View File
@@ -160,5 +160,5 @@ class TrytonConfigParser(configparser.ConfigParser):
config = TrytonConfigParser()
if os.path.basename(main.__file__) != 'trytond-stat':
if os.path.basename(getattr(main, '__file__', '')) != 'trytond-stat':
status.start(config.get('database', 'path'))