Skip to content

Commit 6e588d4

Browse files
Re-wrap long lines.
1 parent 3464624 commit 6e588d4

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

Lib/logging/handlers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,11 @@ def __init__(self, filename, when='h', interval=1, backupCount=0,
282282
# path object (see Issue #27493), but self.baseFilename will be a string
283283
filename = self.baseFilename
284284
if os.path.exists(filename):
285-
# Use the minimum of file creation and modification time as the base of the
286-
# rollover calculation
285+
# Use the minimum of file creation and modification time as
286+
# the base of the rollover calculation
287287
stat_result = os.stat(filename)
288-
# Use st_birthtime whenever it is available or use st_ctime instead otherwise
288+
# Use st_birthtime whenever it is available or use st_ctime
289+
# instead otherwise
289290
try:
290291
creation_time = stat_result.st_birthtime
291292
except AttributeError:

Lib/test/support/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,8 @@ def skip_wasi_stack_overflow():
621621
or is_android
622622
)
623623

624-
# At the moment, st_birthtime attribute is only supported on Windows, MacOS and FreeBSD
624+
# At the moment, st_birthtime attribute is only supported on Windows,
625+
# MacOS and FreeBSD.
625626
has_st_birthtime = sys.platform.startswith(("win", "freebsd", "darwin"))
626627

627628
def requires_fork():

Lib/test/test_logging.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6615,7 +6615,8 @@ def test_rollover(self):
66156615
print(tf.read())
66166616
self.assertTrue(found, msg=msg)
66176617

6618-
@unittest.skipUnless(support.has_st_birthtime, "st_birthtime not available or supported by Python on this OS")
6618+
@unittest.skipUnless(support.has_st_birthtime,
6619+
"st_birthtime not available or supported by Python on this OS")
66196620
def test_rollover_based_on_st_birthtime_only(self):
66206621
def add_record(message: str) -> None:
66216622
fh = logging.handlers.TimedRotatingFileHandler(
@@ -6628,15 +6629,17 @@ def add_record(message: str) -> None:
66286629

66296630
add_record('testing - initial')
66306631
self.assertLogFile(self.fn)
6631-
# Sleep a little over the half of rollover time - and this value must be over
6632-
# 2 seconds, since this is the mtime resolution on FAT32 filesystems.
6632+
# Sleep a little over the half of rollover time - and this value
6633+
# must be over 2 seconds, since this is the mtime resolution on
6634+
# FAT32 filesystems.
66336635
time.sleep(2.1)
66346636
add_record('testing - update before rollover to renew the st_mtime')
66356637
time.sleep(2.1) # a little over the half of rollover time
66366638
add_record('testing - new record supposedly in the new file after rollover')
66376639

6638-
# At this point, the log file should be rotated if the rotation is based
6639-
# on creation time but should be not if it's based on creation time
6640+
# At this point, the log file should be rotated if the rotation
6641+
# is based on creation time but should be not if it's based on
6642+
# creation time.
66406643
found = False
66416644
now = datetime.datetime.now()
66426645
GO_BACK = 5 # seconds

0 commit comments

Comments
 (0)