Fix-up previous commit f17d7e9 (#967)

This commit is contained in:
s3mple 2018-08-24 20:50:55 +03:00 committed by Lonami
parent f17d7e9c5e
commit 29d122e810
2 changed files with 4 additions and 4 deletions

View File

@ -52,7 +52,7 @@ class UserMethods(TelegramBaseClient):
exceptions.append(None) exceptions.append(None)
results.append(result) results.append(result)
request_index += 1 request_index += 1
if exceptions: if any(x is not None for x in exceptions):
raise MultiError(exceptions, results, requests) raise MultiError(exceptions, results, requests)
else: else:
return results return results

View File

@ -78,13 +78,13 @@ class MultiError(Exception):
raise ValueError( raise ValueError(
'Need result, exception and request for each error') 'Need result, exception and request for each error')
for e, req in zip(exceptions, requests): for e, req in zip(exceptions, requests):
if not isinstance(e, BaseException): if not isinstance(e, BaseException) and e is not None:
raise TypeError( raise TypeError(
'Expected and exception object, not %r' % e "Expected an exception object, not '%r'" % e
) )
if not isinstance(req, TLRequest): if not isinstance(req, TLRequest):
raise TypeError( raise TypeError(
'Expected TLRequest object, not %r' % req "Expected TLRequest object, not '%r'" % req
) )
if len(exceptions) == 1: if len(exceptions) == 1: