Skip to content

Commit

Permalink
Improved handling of delayed exports
Browse files Browse the repository at this point in the history
  • Loading branch information
paynejd committed Feb 24, 2021
1 parent c6be94d commit 871dc84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions ocldev/oclexport.py
Expand Up @@ -98,8 +98,8 @@ def load_export(repo_version_url='', oclapitoken='', do_wait_for_export=False,
request_export = requests.get(
repo_export_url, allow_redirects=True, headers=oclapiheaders)
request_export.raise_for_status()
if 200 < request_export.status_code < 300:
continue
if request_export.status_code == 200:
break

if request_export.status_code != 200:
raise OclExportNotAvailableError(
Expand All @@ -113,7 +113,6 @@ def load_export(repo_version_url='', oclapitoken='', do_wait_for_export=False,
export_string_handle = six.BytesIO(content)
else:
export_string_handle = six.StringIO(content)

zipref = zipfile.ZipFile(export_string_handle, "r")
if 'export.json' in zipref.namelist():
repo_export = json.loads(zipref.read('export.json'))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='ocldev',
version='0.1.85',
version='0.1.86',
author='Open Concept Lab',
author_email='info@openconceptlab.org',
description='Python development library for working with OCL resources and APIs',
Expand Down

0 comments on commit 871dc84

Please sign in to comment.