Skip to content

Commit

Permalink
fix python 2.3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
anandology committed Jan 6, 2009
1 parent f17cb7b commit 5c0d10e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web/http.py
Expand Up @@ -60,7 +60,13 @@ def modified(date=None, etag=None):
`True` and sets the response status to `304 Not Modified`. It also
sets `Last-Modified and `ETag` output headers.
"""
n = set(x.strip('" ') for x in web.ctx.env.get('HTTP_IF_NONE_MATCH', '').split(','))
try:
from __builtin__ import set
except ImportError:
# for python 2.3
from sets import Set as set

n = set([x.strip('" ') for x in web.ctx.env.get('HTTP_IF_NONE_MATCH', '').split(',')])
m = net.parsehttpdate(web.ctx.env.get('HTTP_IF_MODIFIED_SINCE', '').split(';')[0])
validate = False
if etag:
Expand Down

0 comments on commit 5c0d10e

Please sign in to comment.