Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/controlpanel/model/datetime.py4
-rw-r--r--src/controlpanel/model/language.py4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/controlpanel/model/datetime.py b/src/controlpanel/model/datetime.py
index a449fd0..4a4c560 100644
--- a/src/controlpanel/model/datetime.py
+++ b/src/controlpanel/model/datetime.py
@@ -29,6 +29,10 @@ _zone_tab = '/usr/share/zoneinfo/zone.tab'
def _initialize():
'''Initialize the docstring of the set function'''
+ if set_timezone.__doc__ is None:
+ # when running under 'python -OO', all __doc__ fields are None,
+ # so += would fail -- and this function would be unnecessary anyway.
+ return
timezones = read_all_timezones()
for timezone in timezones:
set_timezone.__doc__ += timezone + '\n'
diff --git a/src/controlpanel/model/language.py b/src/controlpanel/model/language.py
index d835f77..404d9dd 100644
--- a/src/controlpanel/model/language.py
+++ b/src/controlpanel/model/language.py
@@ -53,6 +53,10 @@ def read_all_languages():
return locales
def _initialize():
+ if set_language.__doc__ is None:
+ # when running under 'python -OO', all __doc__ fields are None,
+ # so += would fail -- and this function would be unnecessary anyway.
+ return
languages = read_all_languages()
set_language.__doc__ += '\n'
for lang in languages: