]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed compile error in issue #22410. The _locale module is optional.
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 30 Oct 2014 23:37:03 +0000 (01:37 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Thu, 30 Oct 2014 23:37:03 +0000 (01:37 +0200)
1  2 
Lib/re.py

diff --cc Lib/re.py
index e731a69bca31921f0ac0ffbc9ced37c4403aeeea,199afee4b90418df7885a52246f173821bb6785f..0b1cb46ab32d5bfa1f865ed7963f62d3cc422090
+++ b/Lib/re.py
@@@ -122,16 -122,16 +122,19 @@@ This module also defines an exception '
  import sys
  import sre_compile
  import sre_parse
- import _locale
+ try:
+     import _locale
+ except ImportError:
+     _locale = None
  
  # public symbols
 -__all__ = [ "match", "fullmatch", "search", "sub", "subn", "split", "findall",
 -    "compile", "purge", "template", "escape", "A", "I", "L", "M", "S", "X",
 -    "U", "ASCII", "IGNORECASE", "LOCALE", "MULTILINE", "DOTALL", "VERBOSE",
 -    "UNICODE", "error" ]
 +__all__ = [
 +    "match", "fullmatch", "search", "sub", "subn", "split",
 +    "findall", "finditer", "compile", "purge", "template", "escape",
 +    "error", "A", "I", "L", "M", "S", "X", "U",
 +    "ASCII", "IGNORECASE", "LOCALE", "MULTILINE", "DOTALL", "VERBOSE",
 +    "UNICODE",
 +]
  
  __version__ = "2.2.1"