mirror of
https://github.com/GTFOBins/GTFOBins.github.io.git
synced 2026-03-08 06:56:15 +01:00
15 lines
367 B
Python
15 lines
367 B
Python
from .error import LinterError
|
|
|
|
import yaml
|
|
|
|
|
|
def load(path):
|
|
# try to load the YAML file reporting parsing errors
|
|
try:
|
|
with open(path, 'r') as fs:
|
|
text = fs.read()
|
|
data = yaml.safe_load(text)
|
|
return text, data
|
|
except yaml.YAMLError as e:
|
|
raise LinterError(f'{e.problem} at line {e.problem_mark.line}')
|