Skip to content

Commit

Permalink
Merge pull request #562 from RussellTaylor83/master
Browse files Browse the repository at this point in the history
Update api.py
  • Loading branch information
joshthecoder committed Feb 21, 2015
2 parents 24ca4ea + e1466e0 commit f8fa8ec
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 @@ -1271,8 +1271,8 @@ def _pack_image(filename, max_size, form_field="image", f=None):
try:
if os.path.getsize(filename) > (max_size * 1024):
raise TweepError('File is too big, must be less than %skb.' % max_size)
except os.error:
raise TweepError('Unable to access file')
except os.error as e:
raise TweepError('Unable to access file: %s' % e.strerror)

# build the mulitpart-formdata body
fp = open(filename, 'rb')
Expand Down

0 comments on commit f8fa8ec

Please sign in to comment.