summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tmpl.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tmpl.py b/tmpl.py
index e9f3483..eae8d23 100644
--- a/tmpl.py
+++ b/tmpl.py
@@ -24,9 +24,11 @@ def select_language():
if cherrypy.thread_data.lang != None:
lang = cherrypy.thread_data.lang
return languages[lang if languages.has_key(lang) else 'en']
- accept = cherrypy.request.headers['Accept-Language']
- try: accept = str(accept)
- except: accept = None
+ try:
+ accept = cherrypy.request.headers['Accept-Language']
+ accept = str(accept)
+ except Exception:
+ accept = None
if accept is not None:
for group in accept.split(';'):
for lang in group.split(','):