LightningRpc should accept pathlib Path

Not sure why socket does not accept pathlib, but just added some code to transform the path to string.
It is not the most pretty code, but better than these:
https://stackoverflow.com/questions/58647584/how-to-test-if-object-is-a-pathlib-path
This commit is contained in:
manreo 2022-01-04 10:43:25 -05:00 committed by Christian Decker
parent 019b31c522
commit dded47e332

View File

@ -223,7 +223,7 @@ class UnixSocket(object):
"""
def __init__(self, path: str):
self.path = path
self.path = str(path) if 'pathlib' in str(type(path)) else path
self.sock: Optional[socket.SocketType] = None
self.connect()