fix order of operations in split_posts_by_length

pull/25/head
Mallory Hancock 2017-11-17 11:34:01 -08:00
parent 1b67b03012
commit 8d92367fe3
1 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,7 @@ tw_auth.set_access_token(settings.TWITTER_TOKEN, settings.TWITTER_TOKEN_SECRET)
twitter = tweepy.API(tw_auth) twitter = tweepy.API(tw_auth)
def split_posts_by_length(text, length): def split_posts_by_length(text, length):
pattern = '.{,%d}(?:\s|$)' % length - 1 pattern = '.{,%d}(?:\s|$)' % (length - 1)
chunks = re.findall(pattern, text) chunks = re.findall(pattern, text)
posts = [] posts = []
post = '' post = ''