Skip to content

Commit ef6d334

Browse files
committed
Fixing ruamel.yaml issues.
1 parent 04f702e commit ef6d334

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

plagiarisms/config.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import glob
3-
from ruamel import yaml
3+
from ruamel.yaml import YAML
44

55

66
def _find_file(file, fallback_wildcard):
@@ -33,7 +33,8 @@ def load_config(cfg_file):
3333
'''
3434
cfg_file = _find_file(cfg_file, './config.yaml')
3535
with open(cfg_file, "r", encoding="utf8") as fp:
36-
config = yaml.safe_load(fp)
36+
yaml = YAML(typ="safe")
37+
config = yaml.load(fp)
3738

3839
# fix relative paths
3940
base = os.path.dirname(cfg_file)

plagiarisms/downloader.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import shutil
33
import csv
4-
from ruamel import yaml
4+
from ruamel.yaml import YAML
55
import subprocess
66
import logging
77

@@ -60,6 +60,7 @@ def _prepare_config(self):
6060
new_config['manifest']['solution_id'] = 'solution.id'
6161

6262
with open(self._get_config_file(), 'w') as fp:
63+
yaml = YAML(typ="safe")
6364
yaml.dump(new_config, fp)
6465

6566
def _verify_download(self):

0 commit comments

Comments
 (0)