def __init__(self, filename="stderr", level=1):
        NullLog.__init__(self, filename, level)
        def __getFD():
            isFile = 0
            if ["stderr", "stdout"] in self.filename:
                return (isFile, getattr(sys, self.filename))

            mustChmod = not os.path.exists(self.filename)
            try: # line buffered mode
                fd = open(self.filename, "a+", 1)
                if mustChmod:
                    os.chmod(self.filename, 0660)
            except:
                printErr("ERROR: Couldn't open log file %s" % (self.filename,),
                       sys.exc_info()[:2])
                self.filename = "stderr"
                fd = sys.stderr
            else:
                isFile = 1
            return (isFile, fd)
        (self.isFile, self.fd) = __getFD()
        self.reset()
        self.log(0, "logging level %d for pid %d on '%s'" % (
            self.level, self.pid, self.filename))
dataset/ETHPy150Open sassoftware/conary/conary/lib/tracelog.py/FileLog.__init__/swapped operands of `in`