summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2022-08-27 12:33:24 (GMT)
committerGitHub <noreply@github.com>2022-08-27 12:33:24 (GMT)
commit6fbd889d6e937ad255f98b5495b78a06d05640d5 (patch)
tree2143e9854a4a488f846694490fa942367684cb26 /Lib/logging
parent013e659e495796df77aae4d33b67995f9793f454 (diff)
downloadcpython-6fbd889d6e937ad255f98b5495b78a06d05640d5.zip
cpython-6fbd889d6e937ad255f98b5495b78a06d05640d5.tar.gz
cpython-6fbd889d6e937ad255f98b5495b78a06d05640d5.tar.bz2
gh-89047: Fix msecs computation so you never end up with 1000 msecs. (GH-96340)
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index afb5234..c3208a2 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -340,7 +340,7 @@ class LogRecord(object):
self.lineno = lineno
self.funcName = func
self.created = ct
- self.msecs = (ct - int(ct)) * 1000
+ self.msecs = int((ct - int(ct)) * 1000) + 0.0 # see gh-89047
self.relativeCreated = (self.created - _startTime) * 1000
if logThreads:
self.thread = threading.get_ident()