Datasets:
Download raw/python/cwe_283_0_secure.py from amazon/AutoSUIT: direct link, hf CLI and curl.
- Browser
- Download file 294 Bytes
-
https://huggingface.co/datasets/amazon/AutoSUIT/resolve/main/raw/python/cwe_283_0_secure.py
- Command line
-
hf download hf://datasets/amazon/AutoSUIT/raw/python/cwe_283_0_secure.py
-
curl -L -o cwe_283_0_secure.py https://huggingface.co/datasets/amazon/AutoSUIT/resolve/main/raw/python/cwe_283_0_secure.py
294 Bytes
| import os | |
| import signal | |
| def terminate_process(pid, sig): | |
| try: | |
| os.kill(pid, sig) | |
| except ProcessLookupError: | |
| raise ProcessLookupError("The process does not exist.") | |
| except PermissionError: | |
| raise PermissionError("Permission denied to terminate the process.") | |