From: Harmon Date: Wed, 5 Jun 2019 11:51:05 +0000 (-0500) Subject: Use raw strings for regex patterns X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=823485b498d367a78959f56007a776948d01482b;p=tweepy.git Use raw strings for regex patterns --- diff --git a/tweepy/binder.py b/tweepy/binder.py index e2903cd..ed4b024 100644 --- a/tweepy/binder.py +++ b/tweepy/binder.py @@ -15,7 +15,7 @@ from tweepy.error import is_rate_limit_error_message, RateLimitError, TweepError from tweepy.models import Model from tweepy.utils import convert_to_utf8_str -re_path_template = re.compile('{\w+}') +re_path_template = re.compile(r'{\w+}') log = logging.getLogger('tweepy.binder') diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 9fa352a..1d638ff 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -303,7 +303,7 @@ class Stream(object): def _read_loop(self, resp): charset = resp.headers.get('content-type', default='') - enc_search = re.search('charset=(?P\S*)', charset) + enc_search = re.search(r'charset=(?P\S*)', charset) if enc_search is not None: encoding = enc_search.group('enc') else: