From b7d3235e808f84f797a689ade0ed7bb7a4096022 Mon Sep 17 00:00:00 2001 From: leyghisbb Date: Sun, 30 Aug 2020 11:17:54 +0200 Subject: [PATCH] Fixed file close for source code text --- extensions/fablabchemnitz_sourcecodetext.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/extensions/fablabchemnitz_sourcecodetext.py b/extensions/fablabchemnitz_sourcecodetext.py index 467be047..3886f13c 100644 --- a/extensions/fablabchemnitz_sourcecodetext.py +++ b/extensions/fablabchemnitz_sourcecodetext.py @@ -27,9 +27,8 @@ class MyEffect(inkex.Effect): for path in matched_files: file = open(path) for word in file.read().split(): - file.close() yield word - + file.close() def add_text(self, node): #Add the text to the node word_generator = self.text_generation() @@ -69,4 +68,4 @@ class MyEffect(inkex.Effect): rect=etree.SubElement(flowRegion,inkex.addNS('rect','svg'),rattribs) self.add_text(flowRoot) -MyEffect().run() \ No newline at end of file +MyEffect().run()