Merge pull request #15574 from dillaman/wip-20223

pybind/rbd: OSError should be picklable

Reviewed-by: Mykola Golub <mgolub@mirantis.com>
This commit is contained in:
Mykola Golub 2017-06-10 18:24:16 +03:00 committed by GitHub
commit c42c9f9afd

View File

@ -394,6 +394,8 @@ class OSError(Error):
def __str__(self):
return '[Errno {0}] {1}'.format(self.errno, self.strerror)
def __reduce__(self):
return (self.__class__, (self.errno, self.strerror))
class PermissionError(OSError):
pass