Skip to content

Commit 923621b

Browse files
nis-spiirxiafu-msft
authored andcommitted
Fix "SyntaxWarning: is with a literal."
1 parent da630ab commit 923621b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

azure-storage-blob/azure/storage/blob/_upload_chunking.py

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

408408
# return fast
409-
if n is 0 or self._buffer.closed:
409+
if n == 0 or self._buffer.closed:
410410
return b''
411411

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

azure-storage-blob/azure/storage/blob/baseblobservice.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ def acquire_container_lease(
10681068
:return: str
10691069
'''
10701070
_validate_not_none('lease_duration', lease_duration)
1071-
if lease_duration is not -1 and \
1071+
if lease_duration != -1 and \
10721072
(lease_duration < 15 or lease_duration > 60):
10731073
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
10741074

@@ -2776,7 +2776,7 @@ def acquire_blob_lease(self, container_name, blob_name,
27762776
'''
27772777
_validate_not_none('lease_duration', lease_duration)
27782778

2779-
if lease_duration is not -1 and \
2779+
if lease_duration != -1 and \
27802780
(lease_duration < 15 or lease_duration > 60):
27812781
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
27822782
lease = self._lease_blob_impl(container_name,

azure-storage-common/azure/storage/common/_connection.py

Lines changed: 1 addition & 1 deletion
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)