mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 11:48:13 +01:00
Fix pickling issue in file_writer on macOS
This commit is contained in:
@@ -11,7 +11,7 @@ class file_writer:
|
||||
) -> None:
|
||||
self.path = path
|
||||
self.file: Optional[IO[Any]] = None
|
||||
self.on_error = on_error or (lambda _x: None)
|
||||
self.on_error = on_error or noop
|
||||
|
||||
def __enter__(self) -> Any:
|
||||
self._open_file()
|
||||
@@ -38,3 +38,7 @@ class file_writer:
|
||||
else:
|
||||
self.on_error("Output pipe broken")
|
||||
raise e
|
||||
|
||||
|
||||
def noop(_: Any) -> None:
|
||||
return None
|
||||
|
||||
@@ -55,7 +55,7 @@ def record( # pylint: disable=too-many-arguments,too-many-locals
|
||||
)
|
||||
|
||||
sync_writer = writer(
|
||||
path_, metadata, append, on_error=_notifier.notify
|
||||
path_, metadata, append, on_error=_notifier.queue.put
|
||||
)
|
||||
|
||||
with async_writer(sync_writer, time_offset, record_stdin) as _writer:
|
||||
|
||||
Reference in New Issue
Block a user