Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 8155f66

Browse files
authored
test_sanity: Fix missing import of sys
and use print instead of directly writing to sys.stderr
1 parent 69e1112 commit 8155f66

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/test_sanity.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import time
77
import pickle
88
import json
9+
import sys
910

1011
from twitter import Twitter, NoAuth, OAuth, OAuth2, read_token_file, TwitterHTTPError
1112
from twitter.api import TwitterDictResponse, TwitterListResponse, POST_ACTIONS, method_for_uri
@@ -27,7 +28,7 @@
2728
with open('tests/bearer_token')as f:
2829
bearer_token = f.readline().strip()
2930
except Exception as e:
30-
sys.stderr.write("ERROR: could not find API keys neither as environment variable nor as local tests/oauth_creds, tests/consumer_creds and tests/bearer_token files")
31+
print("ERROR: could not find API keys neither as environment variable nor as local tests/oauth_creds, tests/consumer_creds and tests/bearer_token files", file=sys.stderr)
3132
exit(1)
3233

3334
oauth = OAuth(*api_keys)

0 commit comments

Comments
 (0)