Skip to content

Commit

Permalink
fix #270 SyntaxWarnings in python3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-mazurkiewicz committed Nov 13, 2024
1 parent 4033fc1 commit e866585
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion iac_validate/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import importlib
import importlib.util
import logging
import warnings
import os
import sys
from typing import Any, Dict, List, Optional
Expand All @@ -25,7 +26,13 @@ def __init__(self, schema_path: str, rules_path: str):
self.schema = None
if os.path.exists(schema_path):
logger.info("Loading schema")
self.schema = yamale.make_schema(schema_path, parser="ruamel")
with warnings.catch_warnings():
warnings.filterwarnings(
action="ignore",
category=SyntaxWarning,
message="invalid escape sequence",
)
self.schema = yamale.make_schema(schema_path, parser="ruamel")
elif schema_path == DEFAULT_SCHEMA:
logger.info("No schema file found")
else:
Expand Down

0 comments on commit e866585

Please sign in to comment.