File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -121,15 +121,13 @@ def join_muc(self, room: str) -> None:
121
121
122
122
# Configure the room. Really, we should only do this if the room is
123
123
# newly created.
124
- form = None
125
124
try :
126
125
form = xep0045 .getRoomConfig (muc_jid )
127
126
except ValueError :
128
- pass
129
- if form :
130
- xep0045 .configureRoom (muc_jid , form )
131
- else :
132
127
logging .error ("Could not configure room: %s" , muc_jid )
128
+ return
129
+
130
+ xep0045 .configureRoom (muc_jid , form )
133
131
134
132
def leave_muc (self , room : str ) -> None :
135
133
if room not in self .rooms :
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
3
3
import argparse
4
+ import contextlib
4
5
import errno
6
+ import json
5
7
import os
6
8
import platform
7
9
import re
8
10
import subprocess
9
11
import sys
10
12
import tempfile
11
13
import traceback
14
+ from typing import List
12
15
13
16
# Use the Zulip virtualenv if available
14
17
sys .path .append ("/home/zulip/deployments/current" )
@@ -24,10 +27,7 @@ except ImportError:
24
27
except ImportError :
25
28
pass
26
29
27
- import json
28
-
29
30
sys .path .insert (0 , os .path .join (os .path .dirname (__file__ ), "../../" ))
30
- from typing import List
31
31
32
32
import zulip
33
33
@@ -129,7 +129,5 @@ if __name__ == "__main__":
129
129
sys .exit (1 )
130
130
process_logs ()
131
131
finally :
132
- try :
132
+ with contextlib . suppress ( OSError ) :
133
133
os .remove (lock_path )
134
- except OSError :
135
- pass
You can’t perform that action at this time.
0 commit comments