mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Added a new fileno() method. ZODB's repozo.py wants this so it can
apply os.fsync() to the GzipFile backup files it creates.
This commit is contained in:
parent
fe393f47c6
commit
5cfb05eef0
3 changed files with 22 additions and 2 deletions
10
Lib/gzip.py
10
Lib/gzip.py
|
@ -5,7 +5,7 @@ but random access is not allowed."""
|
|||
|
||||
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
|
||||
|
||||
import struct, sys, time
|
||||
import os, struct, sys, time
|
||||
import zlib
|
||||
import __builtin__
|
||||
|
||||
|
@ -334,6 +334,14 @@ class GzipFile:
|
|||
def flush(self):
|
||||
self.fileobj.flush()
|
||||
|
||||
def fileno(self):
|
||||
"""Invoke the underlying file object's fileno() method.
|
||||
|
||||
This will raise AttributeError if the underlying file object
|
||||
doesn't support fileno().
|
||||
"""
|
||||
return self.fileobj.fileno()
|
||||
|
||||
def isatty(self):
|
||||
return False
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue