Permalink
Browse files

fix python 2.3 compatibility

  • Loading branch information...
1 parent f17cb7b commit 5c0d10ec950f0cccec64bfb180bb3e1f91a71d72 @anandology anandology committed Jan 6, 2009
Showing with 7 additions and 1 deletion.
  1. +7 −1 web/http.py
View
@@ -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:

0 comments on commit 5c0d10e

Please sign in to comment.