mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
python: Convert "".format to Python 3.6 f-strings.
Generated by pyupgrade --py36-plus --keep-percent-format, but with the
NamedTuple changes reverted (see commit
ba7906a3c6, #15132).
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
@@ -52,7 +52,7 @@ def tracemalloc_dump() -> None:
|
||||
gc.collect()
|
||||
tracemalloc.take_snapshot().dump(path)
|
||||
|
||||
with open('/proc/{}/stat'.format(os.getpid()), 'rb') as f:
|
||||
with open(f'/proc/{os.getpid()}/stat', 'rb') as f:
|
||||
procstat = f.read().split()
|
||||
rss_pages = int(procstat[23])
|
||||
logger.info("tracemalloc dump: tracing %s MiB (%s MiB peak), using %s MiB; rss %s MiB; dumped %s",
|
||||
@@ -79,7 +79,7 @@ def tracemalloc_listen() -> None:
|
||||
listener_pid = os.getpid()
|
||||
|
||||
sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
|
||||
path = "/tmp/tracemalloc.{}".format(os.getpid())
|
||||
path = f"/tmp/tracemalloc.{os.getpid()}"
|
||||
sock.bind(path)
|
||||
thread = threading.Thread(target=lambda: tracemalloc_listen_sock(sock),
|
||||
daemon=True)
|
||||
|
||||
Reference in New Issue
Block a user