Skip to content

Commit

Permalink
Merge pull request #547 from skoczen/master
Browse files Browse the repository at this point in the history
Fixes error message on file too big to reflect actual file size limit.
  • Loading branch information
joshthecoder committed Jan 28, 2015
2 parents c419c54 + 3b4bbab commit fdf1331
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tweepy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ def _pack_image(filename, max_size, form_field="image", f=None):
if f is None:
try:
if os.path.getsize(filename) > (max_size * 1024):
raise TweepError('File is too big, must be less than 700kb.')
raise TweepError('File is too big, must be less than %skb.' % max_size)
except os.error:
raise TweepError('Unable to access file')

Expand All @@ -1279,7 +1279,7 @@ def _pack_image(filename, max_size, form_field="image", f=None):
else:
f.seek(0, 2) # Seek to end of file
if f.tell() > (max_size * 1024):
raise TweepError('File is too big, must be less than 700kb.')
raise TweepError('File is too big, must be less than %skb.' % max_size)
f.seek(0) # Reset to beginning of file
fp = f

Expand Down

0 comments on commit fdf1331

Please sign in to comment.