Skip to content

Commit

Permalink
Switched all printing to stderr to printing to stdout. Fixes #283.
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankramer committed Sep 14, 2019
1 parent afcb9f7 commit e93b61f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions e2e/queryit.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ class Color:


def eprint(*args, color=Color.FAIL, **kwargs):
"""
Like print but to stderr
"""
sys.stderr.write(color)
print(*args, file=sys.stderr, **kwargs)
print(Color.ENDC, file=sys.stderr)
sys.stdout.write(color)
print(*args, **kwargs)
print(Color.ENDC)

def exec_query(endpoint_url: str, sparql: str,
max_send: int = 4096) -> Dict[str, Any]:
Expand Down Expand Up @@ -220,6 +217,7 @@ def main() -> None:
'(%s)' % query_type + Color.ENDC)
print('SPARQL:')
print(query_sparql)
sys.stdout.flush()
result = exec_query(endpoint_url, query_sparql)
if not result:
# A print was already done in exec_query()
Expand Down

0 comments on commit e93b61f

Please sign in to comment.