Python 3.5 fixes

`typing.Deque` was introduced in Python 3.6, so we can only use it when
we no longer support Blender 2.79.
This commit is contained in:
Sybren A. Stüvel
2019-03-01 15:12:24 +01:00
parent 8c822c5b76
commit dabb249e9b
3 changed files with 17 additions and 7 deletions
+3 -3
View File
@@ -182,7 +182,7 @@ class ShamanTransferrer(bat_transfer.FileTransferer):
def _send_checkout_def_to_shaman(self, definition_file: bytes,
allowed_relpaths: typing.Set[str]) \
-> typing.Optional[typing.Deque[str]]:
-> typing.Optional[collections.deque]:
"""Send the checkout definition file to the Shaman.
:return: An iterable of paths (relative to the project root) that still
@@ -196,7 +196,7 @@ class ShamanTransferrer(bat_transfer.FileTransferer):
self.error_set(msg)
return None
to_upload = collections.deque() # type: typing.Deque[str]
to_upload = collections.deque() # type: collections.deque
for line in resp.iter_lines():
response, path = line.decode().split(' ', 1)
self.log.debug(' %s: %s', response, path)
@@ -224,7 +224,7 @@ class ShamanTransferrer(bat_transfer.FileTransferer):
return to_upload
def _upload_files(self, to_upload: typing.Deque[str]) -> typing.Set[str]:
def _upload_files(self, to_upload: collections.deque) -> typing.Set[str]:
"""Actually upload the files to Shaman.
Returns the set of files that we did not upload.