Azure / azure-storage-python

Microsoft Azure Storage Library for Python
https://azure-storage.readthedocs.io
MIT License
339 stars 241 forks source link

Fix "SyntaxWarning: `is` with a literal." #651

Closed nis-spiir closed 4 years ago

msftclas commented 4 years ago

CLA assistant check
All CLA requirements met.

codecov-io commented 4 years ago

Codecov Report

Merging #651 into master will not change coverage by %. The diff coverage is 50.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #651   +/-   ##
=======================================
  Coverage   87.01%   87.01%           
=======================================
  Files          52       52           
  Lines        5285     5285           
  Branches      566      566           
=======================================
  Hits         4599     4599           
  Misses        513      513           
  Partials      173      173           
Impacted Files Coverage Δ
...storage-blob/azure/storage/blob/baseblobservice.py 91.97% <0.00%> (ø)
...torage-blob/azure/storage/blob/_upload_chunking.py 71.86% <100.00%> (ø)
...storage-common/azure/storage/common/_connection.py 97.10% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2ee73e7...ebf4157. Read the comment docs.

nis-spiir commented 4 years ago

Can this be merged?

Also support for python34 seems a bit silly, it was released in March 2014 and is EOL

cdeil commented 4 years ago

@nis-spiir - Thanks!

I also just now got these warnings on Python 3.8 and wanted to send this PR.

Looks like this repo isn't active any more?! See https://github.com/Azure/azure-storage-python/issues/655#issuecomment-623129287

/usr/local/Cellar/azure-cli/2.4.0/libexec/lib/python3.8/site-packages/azure/storage/blob/_upload_chunking.py:403: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if n is 0 or self._buffer.closed:
/usr/local/Cellar/azure-cli/2.4.0/libexec/lib/python3.8/site-packages/azure/storage/blob/baseblobservice.py:1009: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if lease_duration is not -1 and \
/usr/local/Cellar/azure-cli/2.4.0/libexec/lib/python3.8/site-packages/azure/storage/blob/baseblobservice.py:2660: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if lease_duration is not -1 and \
/usr/local/Cellar/azure-cli/2.4.0/libexec/lib/python3.8/site-packages/azure/storage/common/_connection.py:82: SyntaxWarning: "is" with a literal. Did you mean "=="?
  self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme