1. Wei Cheng Pan
  2. bpssl

Commits

Wei Cheng Pan  committed 203fa3a

Change syntax for version compability.

  • Participants
  • Parent commits 1a84f54
  • Branches default

Comments (0)

Files changed (1)

File beproud/django/ssl/middleware.py

View file
  • Ignore whitespace
             host = getattr(django_settings, 'HTTP_HOST', request.get_host())
         newurl = "%s://%s%s" % (protocol,host,request.get_full_path())
         if django_settings.DEBUG and request.method == 'POST':
-            raise RuntimeError, \
+            raise RuntimeError(
         """Django can't perform a SSL redirect while maintaining POST data.
-           Please structure your views so that redirects only occur during GETs."""
+           Please structure your views so that redirects only occur during GETs.""")
 
         return HttpResponseRedirect(newurl)
 
     def __init__(self, urls=None, ignore_urls=None):
         if not urls:
             urls = settings.SSL_URLS
-        self.urls = map(lambda u: re.compile(u) if isinstance(u, basestring) else u, urls)
+        self.urls = [re.compile(u) if isinstance(u, str) else u for u in urls]
         if not ignore_urls:
             ignore_urls = settings.SSL_IGNORE_URLS
-        self.ignore_urls = map(lambda u: re.compile(u) if isinstance(u, basestring) else u, ignore_urls)
+        self.ignore_urls = [re.compile(u) if isinstance(u, str) else u for u in ignore_urls]
 
     def is_handle_url(self, request):
         """