From b7719e2e8d606d851b5ba910f35bec44ae58ade8 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Fri, 17 Aug 2018 14:48:38 +0800 Subject: [PATCH] Fix compatibility with Python 3.7 Simply replace the raise statement with return. All tests pass with Python 3.7.0 here with the change. --- SoftLayer/API.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/SoftLayer/API.py b/SoftLayer/API.py index 3fbab72b6..c5fd95f3a 100644 --- a/SoftLayer/API.py +++ b/SoftLayer/API.py @@ -298,7 +298,7 @@ def iter_call(self, service, method, *args, **kwargs): results = transports.SoftLayerListResult(results, len(results)) else: yield results - raise StopIteration + return for item in results: yield item @@ -313,8 +313,6 @@ def iter_call(self, service, method, *args, **kwargs): offset += limit - raise StopIteration - def __repr__(self): return "Client(transport=%r, auth=%r)" % (self.transport, self.auth)