termux-packages/packages/asciinema/asciinema-asciicast-v2.py.p...

24 lines
832 B
Diff
Raw Normal View History

2018-04-08 23:45:06 +02:00
See https://github.com/asciinema/asciinema/issues/271
diff -u -r ../asciinema-2.0.1/asciinema/asciicast/v2.py ./asciinema/asciicast/v2.py
--- ../asciinema-2.0.1/asciinema/asciicast/v2.py 2018-04-04 09:05:41.000000000 +0200
+++ ./asciinema/asciicast/v2.py 2018-04-06 23:24:44.432657505 +0200
@@ -4,7 +4,16 @@
import json.decoder
import time
import codecs
-from multiprocessing import Process, Queue
+
+try:
+ # Importing synchronize is to detect platforms where
+ # multiprocessing does not work (python issue 3770)
+ # and cause an ImportError. Otherwise it will happen
+ # later when trying to use Queue().
+ from multiprocessing import synchronize, Process, Queue
+except ImportError:
+ from threading import Thread as Process
+ from queue import Queue
from asciinema.pty_recorder import PtyRecorder