Skip to content

Commit dd18f31

Browse files
authored
Fix syntax warnings (#31)
azure/multiapi/storage/v2015_04_05/blob/baseblobservice.py:922: SyntaxWarning: "is not" with a literal. Did you mean "!="? azure/multiapi/storage/v2015_04_05/blob/baseblobservice.py:2265: SyntaxWarning: "is not" with a literal. Did you mean "!="? azure/multiapi/storage/v2015_04_05/_connection.py:79: SyntaxWarning: "is" with a literal. Did you mean "=="? azure/multiapi/storage/v2017_04_17/common/_connection.py:87: SyntaxWarning: "is" with a literal. Did you mean "=="? azure/multiapi/storage/v2017_04_17/blob/_upload_chunking.py:391: SyntaxWarning: "is" with a literal. Did you mean "=="? azure/multiapi/storage/v2017_04_17/blob/baseblobservice.py:977: SyntaxWarning: "is not" with a literal. Did you mean "!="? azure/multiapi/storage/v2017_04_17/blob/baseblobservice.py:2530: SyntaxWarning: "is not" with a literal. Did you mean "!="? azure/multiapi/storage/v2016_05_31/blob/_upload_chunking.py:369: SyntaxWarning: "is" with a literal. Did you mean "=="? azure/multiapi/storage/v2016_05_31/blob/baseblobservice.py:975: SyntaxWarning: "is not" with a literal. Did you mean "!="? azure/multiapi/storage/v2016_05_31/blob/baseblobservice.py:2527: SyntaxWarning: "is not" with a literal. Did you mean "!="? azure/multiapi/storage/v2016_05_31/_connection.py:83: SyntaxWarning: "is" with a literal. Did you mean "=="? azure/multiapi/storage/v2017_07_29/common/_connection.py:79: SyntaxWarning: "is" with a literal. Did you mean "=="? azure/multiapi/storage/v2017_07_29/blob/_upload_chunking.py:392: SyntaxWarning: "is" with a literal. Did you mean "=="? azure/multiapi/storage/v2017_07_29/blob/baseblobservice.py:996: SyntaxWarning: "is not" with a literal. Did you mean "!="? azure/multiapi/storage/v2017_07_29/blob/baseblobservice.py:2566: SyntaxWarning: "is not" with a literal. Did you mean "!="? azure/multiapi/storage/v2018_03_28/common/_connection.py:81: SyntaxWarning: "is" with a literal. Did you mean "=="? azure/multiapi/storage/v2018_03_28/blob/_upload_chunking.py:403: SyntaxWarning: "is" with a literal. Did you mean "=="? azure/multiapi/storage/v2018_03_28/blob/baseblobservice.py:1008: SyntaxWarning: "is not" with a literal. Did you mean "!="? azure/multiapi/storage/v2018_03_28/blob/baseblobservice.py:2607: SyntaxWarning: "is not" with a literal. Did you mean "!="? azure/multiapi/storage/v2017_11_09/common/_connection.py:81: SyntaxWarning: "is" with a literal. Did you mean "=="? azure/multiapi/storage/v2017_11_09/blob/_upload_chunking.py:392: SyntaxWarning: "is" with a literal. Did you mean "=="? azure/multiapi/storage/v2017_11_09/blob/baseblobservice.py:1003: SyntaxWarning: "is not" with a literal. Did you mean "!="? azure/multiapi/storage/v2017_11_09/blob/baseblobservice.py:2573: SyntaxWarning: "is not" with a literal. Did you mean "!="? azure/multiapi/storage/v2018_11_09/common/_connection.py:82: SyntaxWarning: "is" with a literal. Did you mean "=="? azure/multiapi/storage/v2018_11_09/blob/_upload_chunking.py:403: SyntaxWarning: "is" with a literal. Did you mean "=="? azure/multiapi/storage/v2018_11_09/blob/baseblobservice.py:1063: SyntaxWarning: "is not" with a literal. Did you mean "!="? azure/multiapi/storage/v2018_11_09/blob/baseblobservice.py:2719: SyntaxWarning: "is not" with a literal. Did you mean "!="? azure/multiapi/cosmosdb/v2017_04_17/common/_connection.py:91: SyntaxWarning: "is" with a literal. Did you mean "=="?
1 parent 4984868 commit dd18f31

File tree

21 files changed

+28
-28
lines changed

21 files changed

+28
-28
lines changed

azure/multiapi/cosmosdb/v2017_04_17/common/_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
8888
path = parsed_url.path.rstrip('/')
8989

9090
self.primary_endpoint = parsed_url.netloc + path
91-
self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme
91+
self.protocol = self.protocol if parsed_url.scheme == '' else parsed_url.scheme
9292
else:
9393
if not self.account_name:
9494
raise ValueError(_ERROR_STORAGE_MISSING_INFO)

azure/multiapi/storage/v2015_04_05/_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
7676
if custom_domain:
7777
parsed_url = urlparse(custom_domain)
7878
self.primary_endpoint = parsed_url.netloc + parsed_url.path
79-
self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme
79+
self.protocol = self.protocol if parsed_url.scheme == '' else parsed_url.scheme
8080
else:
8181
if not self.account_name:
8282
raise ValueError(_ERROR_STORAGE_MISSING_INFO)

azure/multiapi/storage/v2015_04_05/blob/baseblobservice.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ def acquire_container_lease(
919919
:return: str
920920
'''
921921
_validate_not_none('lease_duration', lease_duration)
922-
if lease_duration is not -1 and\
922+
if lease_duration != -1 and\
923923
(lease_duration < 15 or lease_duration > 60):
924924
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
925925

@@ -2262,7 +2262,7 @@ def acquire_blob_lease(self, container_name, blob_name,
22622262
'''
22632263
_validate_not_none('lease_duration', lease_duration)
22642264

2265-
if lease_duration is not -1 and\
2265+
if lease_duration != -1 and\
22662266
(lease_duration < 15 or lease_duration > 60):
22672267
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
22682268
response = self._lease_blob_impl(container_name,

azure/multiapi/storage/v2016_05_31/_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
8080
path = parsed_url.path.rstrip('/')
8181

8282
self.primary_endpoint = parsed_url.netloc + path
83-
self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme
83+
self.protocol = self.protocol if parsed_url.scheme == '' else parsed_url.scheme
8484
else:
8585
if not self.account_name:
8686
raise ValueError(_ERROR_STORAGE_MISSING_INFO)

azure/multiapi/storage/v2016_05_31/blob/_upload_chunking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def read(self, n):
366366
n = self._length - self._position
367367

368368
# return fast
369-
if n is 0 or self._buffer.closed:
369+
if n == 0 or self._buffer.closed:
370370
return b''
371371

372372
# attempt first read from the read buffer

azure/multiapi/storage/v2016_05_31/blob/baseblobservice.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ def acquire_container_lease(
972972
:return: str
973973
'''
974974
_validate_not_none('lease_duration', lease_duration)
975-
if lease_duration is not -1 and\
975+
if lease_duration != -1 and\
976976
(lease_duration < 15 or lease_duration > 60):
977977
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
978978

@@ -2524,7 +2524,7 @@ def acquire_blob_lease(self, container_name, blob_name,
25242524
'''
25252525
_validate_not_none('lease_duration', lease_duration)
25262526

2527-
if lease_duration is not -1 and\
2527+
if lease_duration != -1 and\
25282528
(lease_duration < 15 or lease_duration > 60):
25292529
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
25302530
lease = self._lease_blob_impl(container_name,

azure/multiapi/storage/v2017_04_17/blob/_upload_chunking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ def read(self, n):
388388
n = self._length - self._position
389389

390390
# return fast
391-
if n is 0 or self._buffer.closed:
391+
if n == 0 or self._buffer.closed:
392392
return b''
393393

394394
# attempt first read from the read buffer and update position

azure/multiapi/storage/v2017_04_17/blob/baseblobservice.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ def acquire_container_lease(
974974
:return: str
975975
'''
976976
_validate_not_none('lease_duration', lease_duration)
977-
if lease_duration is not -1 and \
977+
if lease_duration != -1 and \
978978
(lease_duration < 15 or lease_duration > 60):
979979
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
980980

@@ -2527,7 +2527,7 @@ def acquire_blob_lease(self, container_name, blob_name,
25272527
'''
25282528
_validate_not_none('lease_duration', lease_duration)
25292529

2530-
if lease_duration is not -1 and \
2530+
if lease_duration != -1 and \
25312531
(lease_duration < 15 or lease_duration > 60):
25322532
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
25332533
lease = self._lease_blob_impl(container_name,

azure/multiapi/storage/v2017_04_17/common/_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
8484
path = parsed_url.path.rstrip('/')
8585

8686
self.primary_endpoint = parsed_url.netloc + path
87-
self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme
87+
self.protocol = self.protocol if parsed_url.scheme == '' else parsed_url.scheme
8888
else:
8989
if not self.account_name:
9090
raise ValueError(_ERROR_STORAGE_MISSING_INFO)

azure/multiapi/storage/v2017_07_29/blob/_upload_chunking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def read(self, n):
389389
n = self._length - self._position
390390

391391
# return fast
392-
if n is 0 or self._buffer.closed:
392+
if n == 0 or self._buffer.closed:
393393
return b''
394394

395395
# attempt first read from the read buffer and update position

0 commit comments

Comments
 (0)