File and IO handling in Py3 is different than Py2
Instead of checking whether data isinstance of 'file', then we check that it is file-like _enough_ to be treated as a file (i.e. it hasattr 'read').fix/24-enc-to-file
parent
72174ad535
commit
1bdf0290ab
|
|
@ -180,7 +180,7 @@ class GPG(GPGBase):
|
|||
else:
|
||||
log.warn("No 'default_key' given! Using first key on secring.")
|
||||
|
||||
if isinstance(data, file):
|
||||
if hasattr(data, 'read'):
|
||||
result = self._sign_file(data, **kwargs)
|
||||
elif not _is_stream(data):
|
||||
stream = _make_binary_stream(data, self._encoding)
|
||||
|
|
|
|||
Loading…
Reference in New Issue