Patchwork D5047: hgdemandimport: remove re.ASCII

login
register
mail settings
Submitter phabricator
Date Oct. 13, 2018, 7:28 a.m.
Message ID <differential-rev-PHID-DREV-434i7qy3bpe3emjc4hm6-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/35831/
State New
Headers show

Comments

phabricator - Oct. 13, 2018, 7:28 a.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is a Python 3'ism. Our intent is to only use this code from Python
  2 and Python 2's behavior is essentially the same as re.ASCII AFAIK.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5047

AFFECTED FILES
  hgdemandimport/py3tokenize.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgdemandimport/py3tokenize.py b/hgdemandimport/py3tokenize.py
--- a/hgdemandimport/py3tokenize.py
+++ b/hgdemandimport/py3tokenize.py
@@ -61,6 +61,7 @@ 
 # * Removed module docstring.
 # * Adjusted for relative imports.
 # * absolute_import added.
+# * Removed re.ASCII.
 
 from __future__ import absolute_import
 
@@ -75,8 +76,8 @@ 
 import re
 from .py3token import *
 
-cookie_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)', re.ASCII)
-blank_re = re.compile(br'^[ \t\f]*(?:[#\r\n]|$)', re.ASCII)
+cookie_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)')
+blank_re = re.compile(br'^[ \t\f]*(?:[#\r\n]|$)')
 
 from . import py3token
 __all__ = py3token.__all__ + ["tokenize", "detect_encoding",