diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-12 04:32:26 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-12 04:32:26 +0000 |
commit | 05ed49fe391f153b5404c479267aef062018244f (patch) | |
tree | a34f2800fe809ae4ec277abd48110fb80f7064dc /Python/errors.c | |
parent | 1a0bc6951912d8a2f078da985753258a19083dde (diff) | |
download | cpython-05ed49fe391f153b5404c479267aef062018244f.tar.gz |
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 'Python/errors.c')
0 files changed, 0 insertions, 0 deletions