Skip to content

Commit

Permalink
Fix syntax warnings (#31)
Browse files Browse the repository at this point in the history
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 "=="?
  • Loading branch information
bluca authored Aug 13, 2020
1 parent 4984868 commit dd18f31
Show file tree
Hide file tree
Showing 21 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion azure/multiapi/cosmosdb/v2017_04_17/common/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
path = parsed_url.path.rstrip('/')

self.primary_endpoint = parsed_url.netloc + path
self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme
self.protocol = self.protocol if parsed_url.scheme == '' else parsed_url.scheme
else:
if not self.account_name:
raise ValueError(_ERROR_STORAGE_MISSING_INFO)
Expand Down
2 changes: 1 addition & 1 deletion azure/multiapi/storage/v2015_04_05/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
if custom_domain:
parsed_url = urlparse(custom_domain)
self.primary_endpoint = parsed_url.netloc + parsed_url.path
self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme
self.protocol = self.protocol if parsed_url.scheme == '' else parsed_url.scheme
else:
if not self.account_name:
raise ValueError(_ERROR_STORAGE_MISSING_INFO)
Expand Down
4 changes: 2 additions & 2 deletions azure/multiapi/storage/v2015_04_05/blob/baseblobservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ def acquire_container_lease(
:return: str
'''
_validate_not_none('lease_duration', lease_duration)
if lease_duration is not -1 and\
if lease_duration != -1 and\
(lease_duration < 15 or lease_duration > 60):
raise ValueError(_ERROR_INVALID_LEASE_DURATION)

Expand Down Expand Up @@ -2262,7 +2262,7 @@ def acquire_blob_lease(self, container_name, blob_name,
'''
_validate_not_none('lease_duration', lease_duration)

if lease_duration is not -1 and\
if lease_duration != -1 and\
(lease_duration < 15 or lease_duration > 60):
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
response = self._lease_blob_impl(container_name,
Expand Down
2 changes: 1 addition & 1 deletion azure/multiapi/storage/v2016_05_31/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
path = parsed_url.path.rstrip('/')

self.primary_endpoint = parsed_url.netloc + path
self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme
self.protocol = self.protocol if parsed_url.scheme == '' else parsed_url.scheme
else:
if not self.account_name:
raise ValueError(_ERROR_STORAGE_MISSING_INFO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def read(self, n):
n = self._length - self._position

# return fast
if n is 0 or self._buffer.closed:
if n == 0 or self._buffer.closed:
return b''

# attempt first read from the read buffer
Expand Down
4 changes: 2 additions & 2 deletions azure/multiapi/storage/v2016_05_31/blob/baseblobservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ def acquire_container_lease(
:return: str
'''
_validate_not_none('lease_duration', lease_duration)
if lease_duration is not -1 and\
if lease_duration != -1 and\
(lease_duration < 15 or lease_duration > 60):
raise ValueError(_ERROR_INVALID_LEASE_DURATION)

Expand Down Expand Up @@ -2524,7 +2524,7 @@ def acquire_blob_lease(self, container_name, blob_name,
'''
_validate_not_none('lease_duration', lease_duration)

if lease_duration is not -1 and\
if lease_duration != -1 and\
(lease_duration < 15 or lease_duration > 60):
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
lease = self._lease_blob_impl(container_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def read(self, n):
n = self._length - self._position

# return fast
if n is 0 or self._buffer.closed:
if n == 0 or self._buffer.closed:
return b''

# attempt first read from the read buffer and update position
Expand Down
4 changes: 2 additions & 2 deletions azure/multiapi/storage/v2017_04_17/blob/baseblobservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ def acquire_container_lease(
:return: str
'''
_validate_not_none('lease_duration', lease_duration)
if lease_duration is not -1 and \
if lease_duration != -1 and \
(lease_duration < 15 or lease_duration > 60):
raise ValueError(_ERROR_INVALID_LEASE_DURATION)

Expand Down Expand Up @@ -2527,7 +2527,7 @@ def acquire_blob_lease(self, container_name, blob_name,
'''
_validate_not_none('lease_duration', lease_duration)

if lease_duration is not -1 and \
if lease_duration != -1 and \
(lease_duration < 15 or lease_duration > 60):
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
lease = self._lease_blob_impl(container_name,
Expand Down
2 changes: 1 addition & 1 deletion azure/multiapi/storage/v2017_04_17/common/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
path = parsed_url.path.rstrip('/')

self.primary_endpoint = parsed_url.netloc + path
self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme
self.protocol = self.protocol if parsed_url.scheme == '' else parsed_url.scheme
else:
if not self.account_name:
raise ValueError(_ERROR_STORAGE_MISSING_INFO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def read(self, n):
n = self._length - self._position

# return fast
if n is 0 or self._buffer.closed:
if n == 0 or self._buffer.closed:
return b''

# attempt first read from the read buffer and update position
Expand Down
4 changes: 2 additions & 2 deletions azure/multiapi/storage/v2017_07_29/blob/baseblobservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ def acquire_container_lease(
:return: str
'''
_validate_not_none('lease_duration', lease_duration)
if lease_duration is not -1 and \
if lease_duration != -1 and \
(lease_duration < 15 or lease_duration > 60):
raise ValueError(_ERROR_INVALID_LEASE_DURATION)

Expand Down Expand Up @@ -2563,7 +2563,7 @@ def acquire_blob_lease(self, container_name, blob_name,
'''
_validate_not_none('lease_duration', lease_duration)

if lease_duration is not -1 and \
if lease_duration != -1 and \
(lease_duration < 15 or lease_duration > 60):
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
lease = self._lease_blob_impl(container_name,
Expand Down
2 changes: 1 addition & 1 deletion azure/multiapi/storage/v2017_07_29/common/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
path = parsed_url.path.rstrip('/')

self.primary_endpoint = parsed_url.netloc + path
self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme
self.protocol = self.protocol if parsed_url.scheme == '' else parsed_url.scheme
else:
if not self.account_name:
raise ValueError(_ERROR_STORAGE_MISSING_INFO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def read(self, n):
n = self._length - self._position

# return fast
if n is 0 or self._buffer.closed:
if n == 0 or self._buffer.closed:
return b''

# attempt first read from the read buffer and update position
Expand Down
4 changes: 2 additions & 2 deletions azure/multiapi/storage/v2017_11_09/blob/baseblobservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ def acquire_container_lease(
:return: str
'''
_validate_not_none('lease_duration', lease_duration)
if lease_duration is not -1 and \
if lease_duration != -1 and \
(lease_duration < 15 or lease_duration > 60):
raise ValueError(_ERROR_INVALID_LEASE_DURATION)

Expand Down Expand Up @@ -2570,7 +2570,7 @@ def acquire_blob_lease(self, container_name, blob_name,
'''
_validate_not_none('lease_duration', lease_duration)

if lease_duration is not -1 and \
if lease_duration != -1 and \
(lease_duration < 15 or lease_duration > 60):
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
lease = self._lease_blob_impl(container_name,
Expand Down
2 changes: 1 addition & 1 deletion azure/multiapi/storage/v2017_11_09/common/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
path = parsed_url.path.rstrip('/')

self.primary_endpoint = parsed_url.netloc + path
self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme
self.protocol = self.protocol if parsed_url.scheme == '' else parsed_url.scheme
else:
if not self.account_name:
raise ValueError(_ERROR_STORAGE_MISSING_INFO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def read(self, n):
n = self._length - self._position

# return fast
if n is 0 or self._buffer.closed:
if n == 0 or self._buffer.closed:
return b''

# attempt first read from the read buffer and update position
Expand Down
4 changes: 2 additions & 2 deletions azure/multiapi/storage/v2018_03_28/blob/baseblobservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ def acquire_container_lease(
:return: str
'''
_validate_not_none('lease_duration', lease_duration)
if lease_duration is not -1 and \
if lease_duration != -1 and \
(lease_duration < 15 or lease_duration > 60):
raise ValueError(_ERROR_INVALID_LEASE_DURATION)

Expand Down Expand Up @@ -2604,7 +2604,7 @@ def acquire_blob_lease(self, container_name, blob_name,
'''
_validate_not_none('lease_duration', lease_duration)

if lease_duration is not -1 and \
if lease_duration != -1 and \
(lease_duration < 15 or lease_duration > 60):
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
lease = self._lease_blob_impl(container_name,
Expand Down
2 changes: 1 addition & 1 deletion azure/multiapi/storage/v2018_03_28/common/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
path = parsed_url.path.rstrip('/')

self.primary_endpoint = parsed_url.netloc + path
self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme
self.protocol = self.protocol if parsed_url.scheme == '' else parsed_url.scheme
else:
if not self.account_name:
raise ValueError(_ERROR_STORAGE_MISSING_INFO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def read(self, n):
n = self._length - self._position

# return fast
if n is 0 or self._buffer.closed:
if n == 0 or self._buffer.closed:
return b''

# attempt first read from the read buffer and update position
Expand Down
4 changes: 2 additions & 2 deletions azure/multiapi/storage/v2018_11_09/blob/baseblobservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ def acquire_container_lease(
:return: str
'''
_validate_not_none('lease_duration', lease_duration)
if lease_duration is not -1 and \
if lease_duration != -1 and \
(lease_duration < 15 or lease_duration > 60):
raise ValueError(_ERROR_INVALID_LEASE_DURATION)

Expand Down Expand Up @@ -2716,7 +2716,7 @@ def acquire_blob_lease(self, container_name, blob_name,
'''
_validate_not_none('lease_duration', lease_duration)

if lease_duration is not -1 and \
if lease_duration != -1 and \
(lease_duration < 15 or lease_duration > 60):
raise ValueError(_ERROR_INVALID_LEASE_DURATION)
lease = self._lease_blob_impl(container_name,
Expand Down
2 changes: 1 addition & 1 deletion azure/multiapi/storage/v2018_11_09/common/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(self, service, account_name=None, account_key=None, sas_token=None,
path = parsed_url.path.rstrip('/')

self.primary_endpoint = parsed_url.netloc + path
self.protocol = self.protocol if parsed_url.scheme is '' else parsed_url.scheme
self.protocol = self.protocol if parsed_url.scheme == '' else parsed_url.scheme
else:
if not self.account_name:
raise ValueError(_ERROR_STORAGE_MISSING_INFO)
Expand Down

0 comments on commit dd18f31

Please sign in to comment.