[CalendarServer-changes] [12866] twext/trunk/twext/who/xml.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 10 11:20:46 PDT 2014


Revision: 12866
          http://trac.calendarserver.org//changeset/12866
Author:   sagen at apple.com
Date:     2014-03-10 11:20:46 -0700 (Mon, 10 Mar 2014)
Log Message:
-----------
If the xml filePath doesn't exist, don't then try to close it

Modified Paths:
--------------
    twext/trunk/twext/who/xml.py

Modified: twext/trunk/twext/who/xml.py
===================================================================
--- twext/trunk/twext/who/xml.py	2014-03-10 18:19:32 UTC (rev 12865)
+++ twext/trunk/twext/who/xml.py	2014-03-10 18:20:46 UTC (rev 12866)
@@ -243,6 +243,7 @@
         #
         # Open and parse the file
         #
+        fh = None
         try:
             fh = self.filePath.open()
 
@@ -251,7 +252,8 @@
             except XMLParseError as e:
                 raise ParseError(e)
         finally:
-            fh.close()
+            if fh is not None:
+                fh.close()
 
         #
         # Pull data from DOM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140310/e26a0600/attachment-0001.html>


More information about the calendarserver-changes mailing list