Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-fg committed Oct 22, 2012
1 parent feb5b37 commit 6ad8254
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -12,7 +12,7 @@
setup(

name = 'txSkyDrive', # just trying to mimic tx* naming convention
version = '12.10.26',
version = '12.10.27',
author = 'Mike Kazantsev',
author_email = 'mk.fraggod@gmail.com',
license = 'WTFPL',
Expand Down
9 changes: 5 additions & 4 deletions txskydrive/api_v5.py
Expand Up @@ -350,11 +350,12 @@ def request( self, url, method='get', data=None,
if isinstance(url, unicode): url = url.encode('utf-8')
if isinstance(method, unicode): method = method.encode('ascii')

res_deferred = first_result( timeout,
self.request_agent.request( method.upper(), url,
Headers(dict((k,[v]) for k,v in (headers or dict()).viewitems())), body ) )
code = res_body = None
try:
res = yield first_result( timeout,
self.request_agent.request( method.upper(), url,
Headers(dict((k,[v]) for k,v in (headers or dict()).viewitems())), body ) )
res = yield res_deferred
code = res.code
if code == http.NO_CONTENT: defer.returnValue(None)
if code not in [http.OK, http.CREATED]:
Expand All @@ -372,7 +373,7 @@ def request( self, url, method='get', data=None,
except ( timeout.ActivityTimeout, ResponseFailed,
RequestNotSent, RequestTransmissionFailed ) as err:
if isinstance(err, timeout.ActivityTimeout):
if not res.called: res.cancel()
if not res_deferred.called: res_deferred.cancel()
if res_body and not res_body.called: res_body.cancel()
if self.debug_requests:
log.debug(
Expand Down

0 comments on commit 6ad8254

Please sign in to comment.