Skip to content

Commit

Permalink
Merge pull request #526 from JustAnotherArchivist/fix-pyyaml-6
Browse files Browse the repository at this point in the history
Fix compatibility with PyYAML 6.0 (mandatory `Loader`)
  • Loading branch information
JustAnotherArchivist committed Feb 24, 2022
2 parents 22b3b08 + e050864 commit 1cab846
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pipeline/archivebot/shared_config.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import os
import yaml
try:
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader

def config():
my_dir = os.path.dirname(__file__)
config_file = os.path.join(my_dir, '../../lib/shared_config.yml')

with open(config_file, 'r') as f:
return yaml.load(f.read())
return yaml.load(f.read(), Loader = Loader)

def log_channel():
c = config()
Expand Down

0 comments on commit 1cab846

Please sign in to comment.