We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1089530 commit 20a31b4Copy full SHA for 20a31b4
1 file changed
prometheus_client/exposition.py
@@ -277,7 +277,11 @@ def write_to_textfile(path, registry):
277
if sys.version_info <= (3, 3):
278
# Unable to guarantee atomic rename on Windows and Python<3.3
279
# Remove and rename instead (risks losing the file)
280
- os.remove(path)
+ try:
281
+ os.remove(path)
282
+ except FileNotFoundError:
283
+ pass
284
+
285
os.rename(tmppath, path)
286
else:
287
# os.replace is introduced in Python 3.3 but there is some dispute whether
0 commit comments