Skip to content

Commit

Permalink
Fix deprecations
Browse files Browse the repository at this point in the history
1. `logger.warn()` -> `logger.warning()`
2. Don't use `is not` with a literal
  • Loading branch information
drewbrew committed Sep 27, 2023
1 parent e3af300 commit a6d9eff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tc_aws/aws/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def _normalize_path(self, path):
path_segments = [path]

root_path = self._get_config('ROOT_PATH')
if root_path and root_path is not '':
if root_path and root_path != '':
path_segments.insert(0, root_path)

if self.is_auto_webp:
Expand Down
2 changes: 1 addition & 1 deletion tc_aws/loaders/s3_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _get_key(path, context):
:rtype: string
"""
root_path = context.config.get('TC_AWS_LOADER_ROOT_PATH')
return '/'.join([root_path, path]) if root_path is not '' else path
return '/'.join([root_path, path]) if root_path != '' else path


def _validate_bucket(context, bucket):
Expand Down
3 changes: 1 addition & 2 deletions tc_aws/storages/s3_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async def get_crypto(self, path):
try:
file_key = await self.storage.get(crypto_path)
except ClientError as err:
logger.warn("[STORAGE] s3 key not found at %s" % crypto_path)
logger.warning("[STORAGE] s3 key not found at %s" % crypto_path)
return None

async with file_key['Body'] as stream:
Expand Down Expand Up @@ -161,4 +161,3 @@ async def remove(self, path):
:param string path: Path to delete
"""
return await self.storage.delete(self._normalize_path(path))

0 comments on commit a6d9eff

Please sign in to comment.