From 8af0caea30353cfc39c3f900fed321f6ef23db0a Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 2 Jan 2009 14:51:55 +0100 Subject: [PATCH] Fix #80: use string.ascii_* constants in case locale.setlocale() is somehow called which then leads to UnicodeErrors. --- sphinx/directives/desc.py | 2 +- sphinx/environment.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sphinx/directives/desc.py b/sphinx/directives/desc.py index 68706acf8..3c0bad157 100644 --- a/sphinx/directives/desc.py +++ b/sphinx/directives/desc.py @@ -319,7 +319,7 @@ def parse_c_type(node, ctype): # add cross-ref nodes for all words for part in filter(None, wsplit_re.split(ctype)): tnode = nodes.Text(part, part) - if part[0] in string.letters+'_' and part not in stopwords: + if part[0] in string.ascii_letters+'_' and part not in stopwords: pnode = addnodes.pending_xref( '', reftype='ctype', reftarget=part, modname=None, classname=None) pnode += tnode diff --git a/sphinx/environment.py b/sphinx/environment.py index 826fe8faa..795e4594d 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -19,7 +19,7 @@ import difflib import cPickle as pickle from os import path from glob import glob -from string import uppercase +from string import ascii_uppercase as uppercase from itertools import izip, groupby try: import hashlib