Skip to content

Commit d18e5be

Browse files
committed
[rdf_converter.py] Add subclass_path Check Again
1 parent 171a20f commit d18e5be

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

odml/tools/rdf_converter.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ def __init__(self, odml_documents):
4646
subclass_path = os.path.join(dirname(dirname(dirname(abspath(__file__)))),
4747
'doc', 'section_subclasses.yaml')
4848

49-
with open(subclass_path, "r") as f:
50-
try:
51-
self.section_subclasses = yaml.load(f)
52-
except yaml.parser.ParserError as err:
53-
print(err)
54-
return
49+
if os.path.isfile(subclass_path):
50+
with open(subclass_path, "r") as f:
51+
try:
52+
self.section_subclasses = yaml.load(f)
53+
except yaml.parser.ParserError as err:
54+
print(err)
55+
return
5556

5657
def convert_to_rdf(self):
5758
self.hub_root = URIRef(odmlns.Hub)

0 commit comments

Comments
 (0)