From: Serhiy Storchaka Date: Tue, 17 Sep 2013 07:09:08 +0000 (+0300) Subject: Remove the use of non-existing re.ASCII. X-Git-Tag: v2.7.6rc1~147 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4818f693749af358b1a2b3f96853c756f80856e;p=python Remove the use of non-existing re.ASCII. (fixes a regression in 3d46ef0c62c5, issue #18873) --- diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py index f5665b9dd0..2eae11b541 100644 --- a/Lib/idlelib/IOBinding.py +++ b/Lib/idlelib/IOBinding.py @@ -71,7 +71,7 @@ else: encoding = encoding.lower() -coding_re = re.compile(r'^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)', re.ASCII) +coding_re = re.compile(r'^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)') class EncodingMessage(SimpleDialog): "Inform user that an encoding declaration is needed." diff --git a/Lib/lib2to3/pgen2/tokenize.py b/Lib/lib2to3/pgen2/tokenize.py index 9cf2a69dc5..f6e0284c2f 100644 --- a/Lib/lib2to3/pgen2/tokenize.py +++ b/Lib/lib2to3/pgen2/tokenize.py @@ -236,7 +236,7 @@ class Untokenizer: startline = False toks_append(tokval) -cookie_re = re.compile(r'^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)', re.ASCII) +cookie_re = re.compile(r'^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)') def _get_normal_name(orig_enc): """Imitates get_normal_name in tokenizer.c.""" diff --git a/Tools/scripts/findnocoding.py b/Tools/scripts/findnocoding.py index 838e573353..5d932908d3 100755 --- a/Tools/scripts/findnocoding.py +++ b/Tools/scripts/findnocoding.py @@ -32,7 +32,7 @@ except ImportError: "no sophisticated Python source file search will be done.") -decl_re = re.compile(r'^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)', re.ASCII) +decl_re = re.compile(r'^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)') def get_declaration(line): match = decl_re.match(line)