From 8d92367fe36ddc5d635f55b2419bbf4841fdae8a Mon Sep 17 00:00:00 2001 From: Mallory Hancock Date: Fri, 17 Nov 2017 11:34:01 -0800 Subject: [PATCH] fix order of operations in split_posts_by_length --- ttadmin/common/social.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ttadmin/common/social.py b/ttadmin/common/social.py index 0406692..cdad0f4 100644 --- a/ttadmin/common/social.py +++ b/ttadmin/common/social.py @@ -17,7 +17,7 @@ tw_auth.set_access_token(settings.TWITTER_TOKEN, settings.TWITTER_TOKEN_SECRET) twitter = tweepy.API(tw_auth) def split_posts_by_length(text, length): - pattern = '.{,%d}(?:\s|$)' % length - 1 + pattern = '.{,%d}(?:\s|$)' % (length - 1) chunks = re.findall(pattern, text) posts = [] post = ''