File tree Expand file tree Collapse file tree 5 files changed +9
-7
lines changed Expand file tree Collapse file tree 5 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1
1
import multiprocessing as mp
2
+ import sys
2
3
from typing import Any , Dict
3
4
4
5
import irc .bot
@@ -47,13 +48,13 @@ def check_subscription_or_die(self) -> None:
47
48
resp = self .zulip_client .get_subscriptions ()
48
49
if resp ["result" ] != "success" :
49
50
print ("ERROR: {}" .format (resp ["msg" ]))
50
- exit (1 )
51
+ sys . exit (1 )
51
52
subs = [s ["name" ] for s in resp ["subscriptions" ]]
52
53
if self .stream not in subs :
53
54
print (
54
55
f"The bot is not yet subscribed to stream '{ self .stream } '. Please subscribe the bot to the stream first."
55
56
)
56
- exit (1 )
57
+ sys . exit (1 )
57
58
58
59
def on_nicknameinuse (self , c : ServerConnection , e : Event ) -> None :
59
60
c .nick (c .get_nickname ().replace ("_zulip" , "__zulip" ))
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ if __name__ == "__main__":
143
143
'The key "channel_mapping" is not found in bridge_with_slack_config.py.\n '
144
144
"Your config file may be outdated."
145
145
)
146
- exit (1 )
146
+ sys . exit (1 )
147
147
148
148
print ("Starting slack mirroring bot" )
149
149
print ("MAKE SURE THE BOT IS SUBSCRIBED TO THE RELEVANT ZULIP STREAM(S) & SLACK CHANNEL(S)!" )
Original file line number Diff line number Diff line change 22
22
except ImportError as e :
23
23
print (e , file = sys .stderr )
24
24
print ("Please install the python-dateutil package." , file = sys .stderr )
25
- exit (1 )
25
+ sys . exit (1 )
26
26
27
27
sys .path .insert (0 , os .path .dirname (__file__ ))
28
28
import zulip_codebase_config as config
Original file line number Diff line number Diff line change 112
112
except OSError :
113
113
# We can't write to the logfile, so just print and give up.
114
114
print (f"Unable to store RSS data at { opts .data_dir } ." , file = sys .stderr )
115
- exit (1 )
115
+ sys . exit (1 )
116
116
117
117
log_file = os .path .join (opts .data_dir , "rss-bot.log" )
118
118
log_format = "%(asctime)s: %(message)s"
@@ -130,7 +130,7 @@ logger.addHandler(file_handler)
130
130
def log_error_and_exit (error : str ) -> None :
131
131
logger .error (error )
132
132
logger .error (usage )
133
- exit (1 )
133
+ sys . exit (1 )
134
134
135
135
136
136
class MLStripper (HTMLParser ):
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
import argparse
3
3
import json
4
+ import sys
4
5
from typing import Any , Dict , List
5
6
6
7
import zulip
@@ -56,7 +57,7 @@ while not found_newest:
56
57
# Might occur when the request is not returned with a success status
57
58
print ("Error occured: Payload was:" )
58
59
print (result )
59
- quit ()
60
+ sys . exit ()
60
61
61
62
with open (options .filename , "w+" ) as f :
62
63
print ("Writing %d messages..." % len (all_messages ))
You can’t perform that action at this time.
0 commit comments