Skip to content

Commit

Permalink
Merge 3e952f0 into baf86ce
Browse files Browse the repository at this point in the history
  • Loading branch information
czue committed May 19, 2020
2 parents baf86ce + 3e952f0 commit c71adac
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions commcare_export/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def main(argv):
try:
arg.encode('utf-8')
except UnicodeDecodeError:
sys.stderr.write(u"ERROR: Argument '%s' contains unicode characters. "
u"Only ASCII characters are supported.\n" % unicode(arg, 'utf-8'))
print(u"ERROR: Argument '%s' contains unicode characters. "
u"Only ASCII characters are supported.\n" % unicode(arg, 'utf-8'), file=sys.stderr)
sys.exit(1)

if args.verbose:
Expand All @@ -120,7 +120,7 @@ def main(argv):
exit(0)

if not args.project:
print('commcare-export: error: argument --project is required')
print('commcare-export: error: argument --project is required', file=sys.stderr)
exit(1)

if args.profile:
Expand Down Expand Up @@ -252,7 +252,7 @@ def evaluate_query(env, query):
force_lazy_result(lazy_result)
except requests.exceptions.RequestException as e:
if e.response.status_code == 401:
print("\nAuthentication failed. Please check your credentials.")
print("\nAuthentication failed. Please check your credentials.", file=sys.stderr)
return None
else:
raise
Expand All @@ -267,13 +267,13 @@ def main_with_args(args):

if args.query is None and args.users is False and args.locations is False:
print('At least one the following arguments is required: '
'--query, --users, --locations')
'--query, --users, --locations', file=sys.stderr)
return EXIT_STATUS_ERROR

try:
query = get_queries(args, writer)
except DataExportException as e:
print(e.message)
print(e.message, file=sys.stderr)
return EXIT_STATUS_ERROR

if args.dump_query:
Expand Down

0 comments on commit c71adac

Please sign in to comment.