Skip to content

Commit 4cd0887

Browse files
authored
Simplify Python version comparison.
1 parent 6a016ed commit 4cd0887

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/xopen/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ def _open_reproducible_gzip(filename, mode: str, compresslevel: int):
631631
# is called. This forces it to be closed.
632632
if closefd:
633633
gzip_file.myfileobj = fileobj
634-
if sys.version_info.major == 3 and sys.version_info.minor < 12 and "r" not in mode:
634+
if sys.version_info < (3, 12) and "r" not in mode:
635635
# From version 3.12 onwards, gzip is properly internally buffered for writing.
636636
return io.BufferedWriter(gzip_file) # type: ignore
637637
return gzip_file

0 commit comments

Comments
 (0)