Skip to content

Commit

Permalink
Please flake8
Browse files Browse the repository at this point in the history
References bar-429

Signed-off-by: Giulio Calacoci <[email protected]>
  • Loading branch information
gcalacoci committed Oct 29, 2024
1 parent d7a03e4 commit d2e4d7b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions barman/compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self, config, path):
# If custom_compression_magic is set then we should not assume
# unidentified files are custom compressed and should rely on the
# magic for identification instead.
elif type(config.custom_compression_magic) == str:
elif isinstance(config.custom_compression_magic, str):
# Since we know the custom compression magic we can now add it
# to the class property.
compression_registry["custom"].MAGIC = binascii.unhexlify(
Expand Down Expand Up @@ -421,12 +421,12 @@ def __init__(self, config, compression, path=None):
"""
if (
config.custom_compression_filter is None
or type(config.custom_compression_filter) != str
or not isinstance(config.custom_compression_filter, str)
):
raise CompressionIncompatibility("custom_compression_filter")
if (
config.custom_decompression_filter is None
or type(config.custom_decompression_filter) != str
or not isinstance(config.custom_decompression_filter, str)
):
raise CompressionIncompatibility("custom_decompression_filter")

Expand Down
6 changes: 3 additions & 3 deletions tests/test_compressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,11 @@ def test_get_pg_basebackup_compression(
)
base_backup_compression = get_pg_basebackup_compression(server)

assert type(base_backup_compression) == expected_class
assert type(base_backup_compression) is expected_class
if base_backup_compression is not None:
assert type(base_backup_compression.options) == expected_option_class
assert type(base_backup_compression.options) is expected_option_class
assert (
type(base_backup_compression.compression) == expected_compression_class
type(base_backup_compression.compression) is expected_compression_class
)

def test_get_pg_basebackup_compression_not_supported(self):
Expand Down

0 comments on commit d2e4d7b

Please sign in to comment.