Skip to content

Commit eb3b1b8

Browse files
committed
clnrest: Import sys in except clause explicitly
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]> Changelog-Fixes: Plugin: clnrest crashed on startup when gevent was missing.
1 parent 0b23133 commit eb3b1b8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

plugins/clnrest/clnrest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
except ModuleNotFoundError as err:
2727
# OK, something is not installed?
2828
import json
29+
import sys
2930
getmanifest = json.loads(sys.stdin.readline())
3031
print(json.dumps({'jsonrpc': "2.0",
3132
'id': getmanifest['id'],

0 commit comments

Comments
 (0)