Skip to content

Commit

Permalink
Faster yaml loading using the native loader if available
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-sans-paille authored and ahal committed Mar 21, 2024
1 parent d1dabab commit c8d6a7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@ exclude = [ # TODO fix errors in these files
"src/taskgraph/util/taskcluster.py",
"src/taskgraph/util/vcs.py",
"src/taskgraph/util/workertypes.py",
"src/taskgraph/util/yaml.py",
]
reportIncompatibleMethodOverride = false
6 changes: 5 additions & 1 deletion src/taskgraph/util/yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@


import os
import typing

from yaml.loader import SafeLoader
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader


class UnicodeLoader(SafeLoader):
Expand Down

0 comments on commit c8d6a7f

Please sign in to comment.