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:
+1
-1
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user