[CalendarServer-changes] [2073] CalendarServer/branches/users/cdaboo/timezones-2054/twistedcaldav/ timezones.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Dec 14 11:28:12 PST 2007


Revision: 2073
          http://trac.macosforge.org/projects/calendarserver/changeset/2073
Author:   wsanchez at apple.com
Date:     2007-12-14 11:28:10 -0800 (Fri, 14 Dec 2007)

Log Message:
-----------
Don't close tzStream before we're done with it.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/timezones-2054/twistedcaldav/timezones.py

Modified: CalendarServer/branches/users/cdaboo/timezones-2054/twistedcaldav/timezones.py
===================================================================
--- CalendarServer/branches/users/cdaboo/timezones-2054/twistedcaldav/timezones.py	2007-12-14 19:26:51 UTC (rev 2072)
+++ CalendarServer/branches/users/cdaboo/timezones-2054/twistedcaldav/timezones.py	2007-12-14 19:28:10 UTC (rev 2073)
@@ -64,15 +64,15 @@
         tzStream = openTZ(tzid)
         try:
             calendar = Component.fromStream(tzStream)
+
+            if calendar.name() != "VCALENDAR":
+                raise TimezoneException("%s does not contain valid iCalendar data." % (tzStream.name,))
+
+            # Check that we now have it cached
+            if getTzid(tzid) == None:
+                raise TimezoneException("Could not read timezone %s from %s." % (tzid, tzStream.name))
         finally:
             tzStream.close()
-
-        if calendar.name() != "VCALENDAR":
-            raise TimezoneException("%s does not contain valid iCalendar data." % (tzStream.name,))
-
-        # Check that we now have it cached
-        if getTzid(tzid) == None:
-            raise TimezoneException("Could not read timezone %s from %s." % (tzid, tzStream.name))
         
         return True
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20071214/ce296ea1/attachment.html


More information about the calendarserver-changes mailing list