# Context
async def __aenter__(self):
+ f = io.StringIO()
+
# Make configuration
config = self._make_config(local=True)
- log.debug("Launching Pakfire with configuration:\n%s", self._to_string(config))
-
- async with self.backend.tempfile(mode="w+") as t:
- # Write the configuration to disk
- config.write(t)
- t.flush()
+ # Write the configuration to the buffer
+ config.write(f)
+ f.seek(0)
- # Launch a new Pakfire instance (in a separate thread)
- p = await asyncio.to_thread(pakfire.Pakfire, arch=self.arch, conf=t.name,
- logger=self._log, offline=False)
+ log.debug("Launching Pakfire with configuration:\n%s", f.getvalue())
- return p
+ # Launch a new Pakfire instance (in a separate thread)
+ return await asyncio.to_thread(pakfire.Pakfire, arch=self.arch, conf=f,
+ logger=self._log, offline=False)
async def __aexit__(self, type, value, traceback):
pass