Unfortunately, __future__.with_statement wasn't added until Python 2.5, and yielding from within a try/finally block wasn't legal in 2.4, but I've put another implementation together as https://github.com/stub42/pytz/pull/29.
Unfortunately, __future_ _.with_ statement wasn't added until Python 2.5, and yielding from within a try/finally block wasn't legal in 2.4, but I've put another implementation together as https:/ /github. com/stub42/ pytz/pull/ 29.