lint cleanup

This commit is contained in:
Wayne Werner 2019-03-28 12:41:16 -05:00
parent 28c29459c8
commit 2aa971d2e5
No known key found for this signature in database
GPG key ID: C36D3A8D5BEF0935
2 changed files with 4 additions and 1 deletions

View file

@ -300,9 +300,11 @@ def _decrypt_ciphertexts(cipher, translate_newlines=False):
cipher = to_bytes(cipher)
if translate_newlines:
cipher = cipher.replace(to_bytes(r'\n'), to_bytes('\n'))
def replace(match):
result = to_bytes(_decrypt_ciphertext(match.group()))
return result
ret, num = GPG_CIPHERTEXT.subn(replace, to_bytes(cipher))
if num > 0:
# Remove trailing newlines. Without if crypted value initially specified as a YAML multiline
@ -318,6 +320,7 @@ def _decrypt_ciphertexts(cipher, translate_newlines=False):
pass
return ret
def _decrypt_object(obj, translate_newlines=False):
'''
Recursively try to decrypt any object. If the object is a six.string_types

View file

@ -167,4 +167,4 @@ class GPGTestCase(TestCase, LoaderModuleMockMixin):
self.assertEqual(
gpg.render(crypted, translate_newlines=True),
expected,
)
)