Skip to content

Commit 1d109cd

Browse files
generatedunixname89002005307016meta-codesync[bot]
authored andcommitted
Remove unused type error suppressions - mcrouter
Summary: This diff was automatically generated by the Pyre per-target upgrade tool. It removes `# pyre-fixme` or `pyrefly: ignore` comments that are no longer needed because the underlying type errors have been resolved. Note that it will also aim to ensure type checking runs cleanly, and will add suppressions to existing type errors. #pyreupgrade Differential Revision: D116540362 fbshipit-source-id: 55c6c0413defe6bcb4af58e5704912c0bef7d003
1 parent 4a07a9a commit 1d109cd

7 files changed

Lines changed: 0 additions & 27 deletions

File tree

mcrouter/test/MCProcess.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ def resume(self):
9292
self.proc.send_signal(signal.SIGCONT)
9393

9494
def is_alive(self):
95-
# pyrefly: ignore [missing-attribute]
9695
self.proc.poll()
97-
# pyrefly: ignore [missing-attribute]
9896
return self.proc.returncode is None
9997

10098
def get_log(self):
@@ -115,7 +113,6 @@ def dump(self):
115113
default) so we can debug better."""
116114

117115
try:
118-
# pyrefly: ignore [missing-attribute]
119116
stdout, stderr = self.proc.communicate()
120117
except Exception:
121118
stdout, stderr = b"", b""
@@ -187,24 +184,20 @@ def __init__(
187184
addr="::1", port=thriftPort
188185
)
189186
else:
190-
# pyrefly: ignore [bad-assignment]
191187
self.thrift_client = None
192188

193189
def _sendall(self, s):
194190
if type(s) is not bytes:
195191
s = s.encode("utf8")
196-
# pyrefly: ignore [missing-attribute]
197192
self.socket.sendall(s)
198193

199194
def _fdread(self, n):
200-
# pyrefly: ignore [missing-attribute]
201195
data = self.fd.read(n)
202196
if data is not None and type(data) is not str:
203197
data = data.decode("utf8", errors="backslashreplace")
204198
return data
205199

206200
def _fdreadline(self):
207-
# pyrefly: ignore [missing-attribute]
208201
data = self.fd.readline()
209202
if data is not None and type(data) is not str:
210203
data = data.decode("utf8")
@@ -250,7 +243,6 @@ def ensure_connected(self):
250243
except Exception as e:
251244
retry_count += 1
252245
print(
253-
# pyrefly: ignore [missing-attribute]
254246
f"Cannot connect (errno: {e.errno}). Retry {retry_count} of {self.max_retries}."
255247
)
256248
self.disconnect()
@@ -362,10 +354,8 @@ def _get(self, cmd, keys, expect_cas, return_all_info):
362354
payload = self._fdread(n)
363355
self._fdread(2)
364356
if return_all_info:
365-
# pyrefly: ignore [unsupported-operation]
366357
res[k] = dict({"key": k, "flags": f, "size": n, "value": payload})
367358
if expect_cas:
368-
# pyrefly: ignore [unsupported-operation]
369359
res[k]["cas"] = int(parts[4])
370360
else:
371361
res[k] = payload
@@ -436,20 +426,16 @@ def leaseGet(self, keys):
436426
elif line.startswith("VALUE"):
437427
v, k, f, n = line.split()
438428
assert k in keys
439-
# pyrefly: ignore [unsupported-operation]
440429
res[k] = {"value": self._fdread(int(n)), "token": None}
441430
self._fdread(2)
442431
elif line.startswith("LVALUE"):
443432
v, k, t, f, n = line.split()
444433
assert k in keys
445-
# pyrefly: ignore [unsupported-operation]
446434
res[k] = {"value": self._fdread(int(n)), "token": int(t)}
447435

448436
def expectNoReply(self):
449-
# pyrefly: ignore [missing-attribute]
450437
self.socket.settimeout(0.5)
451438
try:
452-
# pyrefly: ignore [missing-attribute]
453439
self.socket.recv(1)
454440
return False
455441
except TimeoutError:
@@ -965,9 +951,7 @@ def is_alive():
965951
return os.path.exists(f"/proc/{pid}")
966952
return False
967953

968-
# pyrefly: ignore [bad-assignment, bad-override]
969954
self.terminate = terminate
970-
# pyrefly: ignore [bad-assignment, bad-override]
971955
self.is_alive = is_alive
972956

973957
if substitute_config_smc_ports and sr_mock_smc_config:
@@ -1075,10 +1059,8 @@ def __init__(
10751059

10761060
MCProcess.__init__(self, args, asyncPort, pass_fds=pass_fds)
10771061

1078-
# pyrefly: ignore [unbound-name]
10791062
if listenSocketThrift is not None:
10801063
listenSocketThrift.close()
1081-
# pyrefly: ignore [unbound-name]
10821064
if listenSocketAsyncMc is not None:
10831065
listenSocketAsyncMc.close()
10841066

@@ -1100,9 +1082,7 @@ def __init__(self, fifos_dir, extra_args=None):
11001082

11011083
def output(self):
11021084
if not hasattr(self, "stdout"):
1103-
# pyrefly: ignore [missing-attribute]
11041085
self.proc.terminate()
1105-
# pyrefly: ignore [missing-attribute]
11061086
self.stdout = self.proc.stdout.read().decode("ascii", errors="ignore")
11071087
return self.stdout
11081088

mcrouter/test/McrouterTestCase.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ def eventually_get(self, key, expVal, retries=20):
137137
start_time = time.time()
138138
interval = 0.5
139139
while retries > 0:
140-
# pyrefly: ignore [missing-attribute]
141140
if self.mc.get(key) == expVal:
142141
return True
143142
time.sleep(interval)

mcrouter/test/mock_servers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def run(self):
5555
try:
5656
client, address = self.listen_socket.accept()
5757
client.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
58-
# pyrefly: ignore [missing-attribute]
5958
self.runServer(client, address)
6059
client.close()
6160
except OSError as e:

mcrouter/test/test_bad_params.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def timeout_handler(signum, frame):
4040
signal.signal(signal.SIGALRM, timeout_handler)
4141
signal.alarm(timeout)
4242

43-
# pyrefly: ignore [missing-attribute]
4443
for line in self.proc.stderr:
4544
line = line.decode()
4645
stderr += line

mcrouter/test/test_linenumbers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def spawn(self, cmd):
5050
self.proc = subprocess.Popen(cmd, stderr=subprocess.PIPE)
5151

5252
def check_for_error_line_number(self):
53-
# pyrefly: ignore [missing-attribute]
5453
for line in self.proc.stderr:
5554
line = line.decode()
5655
if "Unknown RouteHandle: XYZRoute line: 3" in line:

mcrouter/test/test_mcrouter_basic.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,9 @@ def test_double_bind(self):
146146
mcr2 = Mcrouter(self.null_route_config, port=mcr1.port)
147147
self.assertTrue(mcr1.is_alive())
148148
retries = 20
149-
# pyrefly: ignore [missing-argument]
150149
while mcr2.is_alive() and retries > 0:
151150
retries = retries - 1
152151
time.sleep(1)
153-
# pyrefly: ignore [missing-argument]
154152
self.assertFalse(mcr2.is_alive())
155153

156154
def test_set_exptime(self):

mcrouter/test/test_mcrouter_errors.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ def connect(self, addr):
354354
sock.connect(addr)
355355
return sock
356356
except Exception as e:
357-
# pyrefly: ignore [missing-attribute]
358357
if e.errno == errno.ECONNREFUSED:
359358
pass
360359
else:

0 commit comments

Comments
 (0)