From 1b40a6461d126e3411cd83f1ef3d51eca58910ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 24 Apr 2021 19:24:27 +0200 Subject: [PATCH] Do not fail if __main__ has not __file__ attribute This happens when trytond is launched by a server like uwsgi. issue10333 review334241002 --- trytond/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trytond/config.py b/trytond/config.py index 5816500c26..3c76f7e915 100644 --- a/trytond/config.py +++ b/trytond/config.py @@ -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'))