Skip to content

Commit

Permalink
Added exception handling for httplib.IncompleteRead
Browse files Browse the repository at this point in the history
Works with existing exception handling in __init__.py
  • Loading branch information
Mark Larus committed Feb 13, 2012
1 parent 0b54ff9 commit 51c287c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions reddit/__init__.py
Expand Up @@ -19,6 +19,7 @@
import urllib2
import urlparse
import json
import httplib

import reddit.decorators
import reddit.errors
Expand Down Expand Up @@ -168,6 +169,10 @@ def _request(self, page_url, params=None, url_data=None):
if (error.code not in self.RETRY_CODES or
remaining_attempts == 0):
raise
except httplib.IncompleteRead:
remaining_attempts -=1
if remaining_attempts == 0:
raise

def _json_reddit_objecter(self, json_data):
"""
Expand Down

0 comments on commit 51c287c

Please sign in to comment.