# TODO fix the following in pyhepmc, we should be able
# to use the public API and not these secrets
op = gzip.open if file.suffix == ".gz" else open
self._file = op(file, "wb")
self._ios = pyiostream(self._file)
self._writer = _WrappedWriter(self._ios, None, WriterAscii)
In impy.writer: