details: https://code.tryton.org/tryton/commit/00c6c9ef6ac0
branch: 7.0
user: Cédric Krier <[email protected]>
date: Fri Oct 31 12:11:02 2025 +0100
description:
Set TRYTOND_APPNAME and TRYTOND_TZ only if they are not set or empty
Closes #14322
(grafted from e156432714ee406c1fea3330561b710622c123ee)
diffstat:
trytond/trytond/__init__.py | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (19 lines):
diff -r ca082cbb3673 -r 00c6c9ef6ac0 trytond/trytond/__init__.py
--- a/trytond/trytond/__init__.py Fri Oct 31 11:45:54 2025 +0100
+++ b/trytond/trytond/__init__.py Fri Oct 31 12:11:02 2025 +0100
@@ -15,10 +15,11 @@
__version__ = "7.0.40"
-os.environ.setdefault(
- 'TRYTOND_APPNAME',
- os.path.basename(getattr(__main__, '__file__', 'trytond')))
-os.environ.setdefault('TRYTOND_TZ', os.environ.get('TZ', 'UTC'))
+if not os.environ.get('TRYTOND_APPNAME'):
+ os.environ['TRYTOND_APPNAME'] = os.path.basename(
+ getattr(__main__, '__file__', 'trytond'))
+if not os.environ.get('TRYTOND_TZ'):
+ os.environ['TRYTOND_TZ'] = os.environ.get('TZ') or 'UTC'
os.environ['TZ'] = 'UTC'
if hasattr(time, 'tzset'):
time.tzset()