diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-12 04:32:26 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-12 04:32:26 (GMT) |
commit | aea70e03c40eeb80657c36275dcd843356b0b7fa (patch) | |
tree | 79e5e3df3f6b693003d5d65379fa644a7582f3b0 /Modules/_fileio.c | |
parent | cbbe98f04fb03922ff2e3b6bf35769cf63673153 (diff) | |
download | cpython-aea70e03c40eeb80657c36275dcd843356b0b7fa.zip cpython-aea70e03c40eeb80657c36275dcd843356b0b7fa.tar.gz cpython-aea70e03c40eeb80657c36275dcd843356b0b7fa.tar.bz2 |
Fix the refleak in strftime when converting a %Z with a user defined tzinfo.
I inverted some of the conditionals to reduce indent levels. Hopefully
this makes it a little easier to read.
This code caused the leak:
class FixedOffset(datetime.tzinfo):
def tzname(self, dt): return "UTC"
datetime.time(12, 47, tzinfo=FixedOffset()).strftime('%Z')
This code is very tricky and I'm not positive it works. However,
it neither crashes nor leaks.
Diffstat (limited to 'Modules/_fileio.c')
0 files changed, 0 insertions, 0 deletions