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:
Tim Peters 2004-07-27 21:02:02 +00:00
parent fe393f47c6
commit 5cfb05eef0
3 changed files with 22 additions and 2 deletions

View file

@ -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