diff options
-rw-r--r-- | tmpl.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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(','): |