Skip to content

Commit fdd7215

Browse files
authored
fix: cleanup needed for integration tests on py35 (#653)
1 parent 75ce369 commit fdd7215

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

renku/cli/_providers/dataverse.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ class DataverseProvider(ProviderApi):
106106
def supports(uri):
107107
"""Whether or not this provider supports a given uri."""
108108
is_doi_ = is_doi(uri)
109-
if (is_doi_ is None and check_dataverse_uri(uri)) or \
110-
check_dataverse_doi(is_doi_.group(0)):
111-
return True
112109

113-
return False
110+
is_dataverse_uri = is_doi_ is None and check_dataverse_uri(uri)
111+
is_dataverse_doi = is_doi_ and check_dataverse_doi(is_doi_.group(0))
112+
113+
return is_dataverse_uri or is_dataverse_doi
114114

115115
@staticmethod
116116
def record_id(uri):

renku/cli/dataset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,8 @@ def _init(lock, id_queue):
624624

625625
try:
626626
for p in processing:
627-
p.wait()
628-
p.get()
627+
p.get() # Will internally do the wait() as well.
628+
629629
except HTTPError as e:
630630
raise BadParameter((
631631
'Could not process {0}.\n'
@@ -661,7 +661,7 @@ def extract_dataset(data_folder_, filename):
661661

662662
def stream_to_file(request):
663663
"""Stream bytes to file."""
664-
with open(download_to, 'wb') as f_:
664+
with open(str(download_to), 'wb') as f_:
665665
scaling_factor = 1e-6
666666
unit = 'MB'
667667

renku/utils/doi.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,5 @@ def extract_doi(uri):
3434
"""Return the DOI in a string if there is one."""
3535
match = doi_regexp.match(uri)
3636

37-
if match is None:
38-
return None
39-
40-
return match.group(2)
37+
if match:
38+
return match.group(2)

0 commit comments

Comments
 (0)