File size: 737 Bytes
ae49230
 
 
8ae7da8
 
ae49230
8ae7da8
ae49230
 
 
1
2
3
4
5
6
7
8
9
10
11
with open("api.py", "r") as f:
    content = f.read()

import re
content = re.sub(r'(        if huey is None:\n            raise HTTPException\(status_code=503, detail="Job functionality disabled: Huey/Redis unavailable."\)\n)+', r'        if huey is None:\n            raise HTTPException(status_code=503, detail="Job functionality disabled: Huey/Redis unavailable.")\n', content)

content = re.sub(r'(    if huey is None:\n        raise HTTPException\(status_code=503, detail="Job functionality disabled: Huey/Redis unavailable."\)\n)+', r'    if huey is None:\n        raise HTTPException(status_code=503, detail="Job functionality disabled: Huey/Redis unavailable.")\n', content)

with open("api.py", "w") as f:
    f.write(content)