-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: python3.12 regex syntax compatible(close #92)
- Loading branch information
Showing
2 changed files
with
20 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import os,yaml | ||
import os,yaml,sys | ||
|
||
__all__ = [ | ||
'config', | ||
'_current_path' | ||
] | ||
_current_path = os.path.dirname(os.path.realpath(__file__)) | ||
with open(f'{_current_path}/config.yml') as _f: | ||
config_file = f'{_current_path}/config.yml' | ||
|
||
if not os.path.exists(config_file): | ||
print(f"Config file '{config_file}' not found. Please configure using 'config.yml.default'.") | ||
sys.exit(1) | ||
|
||
with open(config_file) as _f: | ||
config = yaml.load(_f.read(),Loader = yaml.SafeLoader) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters