Skip to content

Commit

Permalink
clnrest: Import sys in except clause explicitly
Browse files Browse the repository at this point in the history
This fixes a crash on startup of core-lightning where gevent could not
be imported. This happens before sys is imported and throws us into the
except clause which calls sys.
By importing it explicitly in the except clause we are not dependend of
the order of imports in the try bracket.

Signed-off-by: Peter Neuroth <[email protected]>
  • Loading branch information
nepet committed Nov 20, 2023
1 parent 8aff6f7 commit 44878ca
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions plugins/clnrest/clnrest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
except ModuleNotFoundError as err:
# OK, something is not installed?
import json
import sys
getmanifest = json.loads(sys.stdin.readline())
print(json.dumps({'jsonrpc': "2.0",
'id': getmanifest['id'],
Expand Down

0 comments on commit 44878ca

Please sign in to comment.