1.1 --- a/DateSupport.py Tue Jul 16 17:10:54 2013 +0200
1.2 +++ b/DateSupport.py Tue Jul 23 00:17:58 2013 +0200
1.3 @@ -632,7 +632,7 @@
1.4 """
1.5
1.6 olson = self.olson_identifier()
1.7 - if olson and pytz:
1.8 + if olson:
1.9 tz = pytz.timezone(olson)
1.10 data = self.padded().as_tuple()[:6]
1.11 dt = datetime.datetime(*data)
1.12 @@ -665,6 +665,8 @@
1.13 period of ambiguity.
1.14 """
1.15
1.16 + self._check_pytz()
1.17 +
1.18 try:
1.19 return self._as_olson_datetime()
1.20 except (pytz.UnknownTimeZoneError, pytz.AmbiguousTimeError):
1.21 @@ -679,6 +681,8 @@
1.22
1.23 "Return whether the time is local and ambiguous."
1.24
1.25 + self._check_pytz()
1.26 +
1.27 try:
1.28 self._as_olson_datetime()
1.29 except (pytz.UnknownTimeZoneError, pytz.AmbiguousTimeError):
1.30 @@ -686,6 +690,11 @@
1.31
1.32 return 0
1.33
1.34 + def _check_pytz(self):
1.35 + if not pytz:
1.36 + raise NotImplementedError, "pytz must be installed for Olson " \
1.37 + "time zones to be supported"
1.38 +
1.39 class Timespan(ActsAsTimespan, Convertible):
1.40
1.41 """
2.1 --- a/README.txt Tue Jul 16 17:10:54 2013 +0200
2.2 +++ b/README.txt Tue Jul 23 00:17:58 2013 +0200
2.3 @@ -64,6 +64,12 @@
2.4 If time zone handling is not required, pytz need not be installed. It is,
2.5 however, highly recommended that pytz be installed.
2.6
2.7 +New in MoinSupport 0.4.1 (Changes since MoinSupport 0.4)
2.8 +--------------------------------------------------------
2.9 +
2.10 + * Introduced an explicit error condition where pytz is not installed and an
2.11 + attempt is made to inspect Olson time zone information.
2.12 +
2.13 New in MoinSupport 0.4 (Changes since MoinSupport 0.3)
2.14 ------------------------------------------------------
2.15