mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
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 <pet.v.ne@gmail.com> Changelog-Fixes: Plugin: clnrest crashed on startup when gevent was missing.
This commit is contained in:
parent
0b23133ab2
commit
eb3b1b8134
@ -26,6 +26,7 @@ try:
|
||||
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'],
|
||||
|
Loading…
Reference in New Issue
Block a user