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

View File

@ -20,6 +20,7 @@ sphinx-autobuild = "*"
sphinx-rtd-theme = "*" sphinx-rtd-theme = "*"
twine = "*" twine = "*"
responses = "*" responses = "*"
pathlib2 = {version = "*",markers = "python_version < '3.6'"}
[requires] [requires]
python_version = "3.5" python_version = "3.5"

17
Pipfile.lock generated
View File

@ -1,7 +1,7 @@
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "f83b8983e69d5d799b27888b538a4a347eca2d4177ea59052be7ae976bee48d2" "sha256": "ae59545d12df926a0c461047c2a5e10d7b26fb27e163f2b6f9e77f6172da9988"
}, },
"pipfile-spec": 6, "pipfile-spec": 6,
"requires": { "requires": {
@ -254,6 +254,15 @@
], ],
"version": "==19.0" "version": "==19.0"
}, },
"pathlib2": {
"hashes": [
"sha256:25199318e8cc3c25dcb45cbe084cc061051336d5a9ea2a12448d3d8cb748f742",
"sha256:5887121d7f7df3603bca2f710e7219f3eca0eb69e0b7cc6e0a022e155ac931a7"
],
"index": "pypi",
"markers": "python_version < '3.6'",
"version": "==2.3.3"
},
"pathtools": { "pathtools": {
"hashes": [ "hashes": [
"sha256:7c35c5421a39bb82e58018febd90e3b6e5db34c5443aaaf742b3f33d4655f1c0" "sha256:7c35c5421a39bb82e58018febd90e3b6e5db34c5443aaaf742b3f33d4655f1c0"
@ -296,10 +305,10 @@
}, },
"pyflakes": { "pyflakes": {
"hashes": [ "hashes": [
"sha256:5e8c00e30c464c99e0b501dc160b13a14af7f27d4dffb529c556e30a159e231d", "sha256:17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0",
"sha256:f277f9ca3e55de669fba45b7393a1449009cff5a37d1af10ebb76c52765269cd" "sha256:d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2"
], ],
"version": "==2.1.0" "version": "==2.1.1"
}, },
"pygments": { "pygments": {
"hashes": [ "hashes": [

View File

@ -182,7 +182,7 @@ class ShamanTransferrer(bat_transfer.FileTransferer):
def _send_checkout_def_to_shaman(self, definition_file: bytes, def _send_checkout_def_to_shaman(self, definition_file: bytes,
allowed_relpaths: typing.Set[str]) \ allowed_relpaths: typing.Set[str]) \
-> typing.Optional[typing.Deque[str]]: -> typing.Optional[collections.deque]:
"""Send the checkout definition file to the Shaman. """Send the checkout definition file to the Shaman.
:return: An iterable of paths (relative to the project root) that still :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) self.error_set(msg)
return None return None
to_upload = collections.deque() # type: typing.Deque[str] to_upload = collections.deque() # type: collections.deque
for line in resp.iter_lines(): for line in resp.iter_lines():
response, path = line.decode().split(' ', 1) response, path = line.decode().split(' ', 1)
self.log.debug(' %s: %s', response, path) self.log.debug(' %s: %s', response, path)
@ -224,7 +224,7 @@ class ShamanTransferrer(bat_transfer.FileTransferer):
return to_upload 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. """Actually upload the files to Shaman.
Returns the set of files that we did not upload. Returns the set of files that we did not upload.