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

+1-1
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

+1-1
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

+2-2
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

+1-1
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

+1-1
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

+2-2
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

+1-1
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

+2-2
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

+1-1
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

+1-1
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

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ def acquire_container_lease(
993993
:return: str
994994
'''
995995
_validate_not_none('lease_duration', lease_duration)
996-
if lease_duration is not -1 and \
996+
if lease_duration != -1 and \
997997
(lease_duration < 15 or lease_duration > 60):
998998
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
999999

@@ -2563,7 +2563,7 @@ def acquire_blob_lease(self, container_name, blob_name,
25632563
'''
25642564
_validate_not_none('lease_duration', lease_duration)
25652565

2566-
if lease_duration is not -1 and \
2566+
if lease_duration != -1 and \
25672567
(lease_duration < 15 or lease_duration > 60):
25682568
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
25692569
lease = self._lease_blob_impl(container_name,

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

+1-1
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
path = parsed_url.path.rstrip('/')
7777

7878
self.primary_endpoint = parsed_url.netloc + 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/v2017_11_09/blob/_upload_chunking.py

+1-1
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

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ def acquire_container_lease(
10001000
:return: str
10011001
'''
10021002
_validate_not_none('lease_duration', lease_duration)
1003-
if lease_duration is not -1 and \
1003+
if lease_duration != -1 and \
10041004
(lease_duration < 15 or lease_duration > 60):
10051005
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
10061006

@@ -2570,7 +2570,7 @@ def acquire_blob_lease(self, container_name, blob_name,
25702570
'''
25712571
_validate_not_none('lease_duration', lease_duration)
25722572

2573-
if lease_duration is not -1 and \
2573+
if lease_duration != -1 and \
25742574
(lease_duration < 15 or lease_duration > 60):
25752575
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
25762576
lease = self._lease_blob_impl(container_name,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
7878
path = parsed_url.path.rstrip('/')
7979

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

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def read(self, n):
400400
n = self._length - self._position
401401

402402
# return fast
403-
if n is 0 or self._buffer.closed:
403+
if n == 0 or self._buffer.closed:
404404
return b''
405405

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

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ def acquire_container_lease(
10051005
:return: str
10061006
'''
10071007
_validate_not_none('lease_duration', lease_duration)
1008-
if lease_duration is not -1 and \
1008+
if lease_duration != -1 and \
10091009
(lease_duration < 15 or lease_duration > 60):
10101010
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
10111011

@@ -2604,7 +2604,7 @@ def acquire_blob_lease(self, container_name, blob_name,
26042604
'''
26052605
_validate_not_none('lease_duration', lease_duration)
26062606

2607-
if lease_duration is not -1 and \
2607+
if lease_duration != -1 and \
26082608
(lease_duration < 15 or lease_duration > 60):
26092609
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
26102610
lease = self._lease_blob_impl(container_name,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
7878
path = parsed_url.path.rstrip('/')
7979

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

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def read(self, n):
400400
n = self._length - self._position
401401

402402
# return fast
403-
if n is 0 or self._buffer.closed:
403+
if n == 0 or self._buffer.closed:
404404
return b''
405405

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

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ def acquire_container_lease(
10601060
:return: str
10611061
'''
10621062
_validate_not_none('lease_duration', lease_duration)
1063-
if lease_duration is not -1 and \
1063+
if lease_duration != -1 and \
10641064
(lease_duration < 15 or lease_duration > 60):
10651065
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
10661066

@@ -2716,7 +2716,7 @@ def acquire_blob_lease(self, container_name, blob_name,
27162716
'''
27172717
_validate_not_none('lease_duration', lease_duration)
27182718

2719-
if lease_duration is not -1 and \
2719+
if lease_duration != -1 and \
27202720
(lease_duration < 15 or lease_duration > 60):
27212721
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
27222722
lease = self._lease_blob_impl(container_name,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
7979
path = parsed_url.path.rstrip('/')
8080

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

0 commit comments

Comments
 (0)