Avoid providing default pipe locations in PipeIOServer

This commit is contained in:
Kristóf Tóth 2019-04-02 11:47:21 +02:00
parent a3d2ea37d5
commit 22d22bc5e3

View File

@ -1,5 +1,3 @@
from os.path import join
from secrets import token_urlsafe
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from threading import Event from threading import Event
@ -17,10 +15,6 @@ class PipeIOServer(ABC):
self._io_threads = (self._reader_thread, self._writer_thread) self._io_threads = (self._reader_thread, self._writer_thread)
def _create_pipes(self): def _create_pipes(self):
if not self.in_pipe or not self.out_pipe:
pipe_id = token_urlsafe(6)
self._in_pipe = join('/tmp', f'in_pipe_{pipe_id}')
self._out_pipe = join('/tmp', f'out_pipe_{pipe_id}')
Pipe(self.in_pipe).recreate() Pipe(self.in_pipe).recreate()
Pipe(self.out_pipe).recreate() Pipe(self.out_pipe).recreate()