Skip to content

Commit

Permalink
Python 2 syntax fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaff committed Jan 5, 2018
1 parent d44cdbf commit 39381ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion mdf_forge/forge.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,10 +935,11 @@ def http_stream(self, results, verbose=True):
"""
if self.__anonymous:
print_("Error: Anonymous HTTP download not yet supported.")
return {
yield {
"success": False,
"message": "Anonymous HTTP download not yet supported."
}
return
# If results have info attached, remove it
if type(results) is tuple:
results = results[0]
Expand Down
6 changes: 4 additions & 2 deletions tests/test_forge.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,9 @@ def test_forge_anonymous(capsys):
out, err = capsys.readouterr()
assert "Error: Anonymous Globus Transfer not supported." in out
# http_stream
with pytest.raises(StopIteration):
next(f.http_stream({}))
res = f.http_stream({})
assert next(res)["success"] is False
out, err = capsys.readouterr()
assert "Error: Anonymous HTTP download not yet supported." in out
with pytest.raises(StopIteration):
next(res)

0 comments on commit 39381ba

Please sign in to comment.