Skip to content

Commit

Permalink
fixed py3 incompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
petr-s committed Mar 3, 2016
1 parent 416813d commit 29c3feb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions clearest/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import functools
import inspect
import re
import urlparse
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse

import six

Expand Down Expand Up @@ -73,7 +76,7 @@ def application(environ, start_response):
if environ[REQUEST_METHOD] in all_registered():
path = tuple(environ[PATH_INFO].split("/"))
query = urlparse.parse_qs(environ[QUERY_STRING]) if QUERY_STRING in environ else tuple()
for signature, (fn, args) in BaseDecorator.registered[environ[REQUEST_METHOD]].iteritems():
for signature, (fn, args) in six.iteritems(BaseDecorator.registered[environ[REQUEST_METHOD]]):
if is_matching(signature, args, path, query):
result = fn()
start_response(STATUS_FMT.format(**HTTP_OK._asdict()),
Expand Down

0 comments on commit 29c3feb

Please sign in to comment.