From af9baca35e67a984a49617c36fd17ca8c6271261 Mon Sep 17 00:00:00 2001 From: Sam Manzi Date: Wed, 27 Apr 2016 19:28:26 +1000 Subject: [PATCH] Change Exportgedcoms open --- gramps/plugins/export/exportgedcom.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gramps/plugins/export/exportgedcom.py b/gramps/plugins/export/exportgedcom.py index 0253ad800..5e5edb7cb 100644 --- a/gramps/plugins/export/exportgedcom.py +++ b/gramps/plugins/export/exportgedcom.py @@ -238,17 +238,17 @@ class GedcomWriter(UpdateCallback): """ self.dirname = os.path.dirname (filename) - self.gedcom_file = open(filename, "w", encoding='utf-8') - self._header(filename) - self._submitter() - self._individuals() - self._families() - self._sources() - self._repos() - self._notes() + with open(filename, "w", encoding='utf-8') as self.gedcom_file: + self._header(filename) + self._submitter() + self._individuals() + self._families() + self._sources() + self._repos() + self._notes() + + self._writeln(0, "TRLR") - self._writeln(0, "TRLR") - self.gedcom_file.close() return True def _writeln(self, level, token, textlines="", limit=72):