pyln-client: use f strings to concatenate JSON ids, handle older integer ids.

We don't really support using pyln-client with older Core Lightning versions,
but this is neater anyway.  I checked: f-strings go back to python 3.6, so
we can use them (I think this may be the first!).

Suggested-by: @MiWCryptAnalytics
Fixes: #5609
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2022-09-20 07:02:58 +09:30 committed by Christian Decker
parent 774d16a72e
commit 5a1c2447cb

View file

@ -335,7 +335,7 @@ class UnixDomainSocketRpc(object):
if cmdprefix is None:
cmdprefix = self.cmdprefix
if cmdprefix:
this_id = cmdprefix + '/' + this_id
this_id = f'{cmdprefix}/{this_id}'
return this_id
def call(self, method, payload=None, cmdprefix=None):