From: W. Trevor King Date: Sat, 18 Feb 2012 20:55:03 +0000 (-0500) Subject: Explicitly use __builtin__.open to avoid open() calling itself. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=115906a5fcb874c000d7f6ec1d828ef2e5ad0d50;p=apachelog.git Explicitly use __builtin__.open to avoid open() calling itself. --- diff --git a/apachelog/file.py b/apachelog/file.py index 5d0c95e..2f8076f 100644 --- a/apachelog/file.py +++ b/apachelog/file.py @@ -1,3 +1,4 @@ +import __builtin__ import gzip as _gzip import os.path as _os_path @@ -26,5 +27,5 @@ def open(filename, openers=None): if openers is None: openers = OPENERS extension = _os_path.splitext(filename)[-1] - opener = openers.get(extension, open) + opener = openers.get(extension, __builtin__.open) return opener(filename, 'r')