]> granicus.if.org Git - python/commitdiff
Expose the fileno() method of the underlying log reader.
authorFred Drake <fdrake@acm.org>
Thu, 18 Jul 2002 19:17:20 +0000 (19:17 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 18 Jul 2002 19:17:20 +0000 (19:17 +0000)
Remove the crufty support for Python's that don't have StopIteration;
the HotShot patch for Python 2.1 has not been maintained.

Lib/hotshot/log.py

index 9084461c290f849fb403bf059454ad65a19a2b3c..a5020dddec9238e35f5cf3397336493b654a1962 100644 (file)
@@ -21,12 +21,6 @@ EXIT  = WHAT_EXIT
 LINE  = WHAT_LINENO
 
 
-try:
-    StopIteration
-except NameError:
-    StopIteration = IndexError
-
-
 class LogReader:
     def __init__(self, logfn):
         # fileno -> filename
@@ -54,6 +48,10 @@ class LogReader:
     def close(self):
         self._reader.close()
 
+    def fileno(self):
+        """Return the file descriptor of the log reader's log file."""
+        return self._reader.fileno()
+
     def addinfo(self, key, value):
         """This method is called for each additional ADD_INFO record.