From 823485b498d367a78959f56007a776948d01482b Mon Sep 17 00:00:00 2001 From: Harmon Date: Wed, 5 Jun 2019 06:51:05 -0500 Subject: [PATCH] Use raw strings for regex patterns --- tweepy/binder.py | 2 +- tweepy/streaming.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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: -- 2.25.1