Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some "is literal" SyntaxWarning #695

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azure-storage-blob/azure/storage/blob/_deserialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ def _parse_sub_response_to_http_response(sub_response):
num_empty_lines += 1
elif line.startswith("x-ms-error-code".encode('utf-8')):
batch_http_sub_response.message = line.decode('utf-8').split(": ")[1].rstrip()
elif num_empty_lines is 2:
elif num_empty_lines == 2:
batch_http_sub_response.body += line
else:
header = line.decode('utf-8').split(": ")[0]
Expand Down
4 changes: 2 additions & 2 deletions azure-storage-blob/azure/storage/blob/_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def _serialize_batch_body(requests, batch_id):
:return: The body bytes for this batch.
"""

if requests is None or len(requests) is 0:
if requests is None or not len(requests):
raise ValueError('Please provide sub-request(s) for this batch request')

delimiter_bytes = (_get_batch_request_delimiter(batch_id, True, False) + _HTTP_LINE_ENDING).encode('utf-8')
Expand Down Expand Up @@ -298,7 +298,7 @@ def _serialize_query(query):
serialized_query.append(query_value)
serialized_query.append("&")

if len(serialized_query) is not 0:
if serialized_query:
del serialized_query[-1]

return ''.join(serialized_query)
2 changes: 1 addition & 1 deletion azure-storage-blob/azure/storage/blob/blockblobservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ def create_blob_from_stream(self, container_name, blob_name, stream, count=None,
data_chunk = data # to store the chunk of data read from stream each time

# keep reading from stream util length of data >= count or reaching the end of stream
while len(data) < count and len(data_chunk) is not 0:
while len(data) < count and len(data_chunk):
data_chunk = stream.read(count - len(data))
data += data_chunk

Expand Down