Fixed compile error in issue #22410. The _locale module is optional.
diff --git a/Lib/re.py b/Lib/re.py
index a82a446..671a904 100644
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -104,7 +104,10 @@
 import sys
 import sre_compile
 import sre_parse
-import _locale
+try:
+    import _locale
+except ImportError:
+    _locale = None
 
 # public symbols
 __all__ = [ "match", "search", "sub", "subn", "split", "findall",
@@ -250,6 +253,8 @@
         if len(_cache) >= _MAXCACHE:
             _cache.clear()
         if p.flags & LOCALE:
+            if not _locale:
+                return p
             loc = _locale.setlocale(_locale.LC_CTYPE)
         else:
             loc = None