Andriy Kornatskyy avatar Andriy Kornatskyy committed 6e3c839

Fixed compatibility issue with python3.3

Comments (0)

Files changed (4)

 		echo 'done.'; \
 	fi
 	$(EASY_INSTALL) -i $(PYPI) -O2 coverage nose pytest \
-		pytest-pep8 pytest-cov wsgiref
+		pytest-pep8 pytest-cov
+	# The following packages available for python == 2.4
+	if [ "$$(echo $(VERSION) | sed 's/\.//')" -eq 24 ]; then \
+		$(EASY_INSTALL) -i $(PYPI) -O2 wsgiref; \
+	fi
 	# The following packages available for python < 3.0
 	if [ "$$(echo $(VERSION) | sed 's/\.//')" -lt 30 ]; then \
 		$(EASY_INSTALL) -i $(PYPI) -O2 mocker; \
 		$(PYTEST) -q -x --pep8 --doctest-modules \
 			src/wheezy/routing; \
 	else \
-		echo 'WARNING: unit tests skipped'; \
+		echo 'WARNING: unit tests skipped due to mocker'; \
 	fi
 
 doctest-cover:

src/wheezy/routing/route.py

 class RegexRoute(object):
     """ Route based on regular expression matching.
     """
-    __slots__ = ('match', 'path', 'path_format', 'kwargs', 'regex')
+    __slots__ = ('match', 'path_format', 'kwargs', 'regex')
 
     def __init__(self, pattern, finishing, kwargs=None):
         pattern = pattern.lstrip('^').rstrip('$')
             ...     'lang': 'en'
             ... })
             >>> matched, kwargs = r.match_with_kwargs('abc/1234')
-            >>> kwargs
-            {'lang': 'en', 'id': '1234'}
+            >>> sorted(kwargs.items())
+            [('id', '1234'), ('lang', 'en')]
 
             ``kwargs`` from ``pattern`` match must override
             defaults.

src/wheezy/routing/router.py

             ... ])
             >>> handler, kwargs = r.match(r'en/msg')
             >>> assert handler == Message
-            >>> kwargs
-            {'lang': 'en', 'id': 1, 'route_name': 'message'}
+            >>> sorted(kwargs.items())
+            [('id', 1), ('lang', 'en'), ('route_name', 'message')]
 
             Otherwise return (None, None)
 

src/wheezy/routing/utils.py

 
         >>> d1 = dict(a=1,b=None,c=2, d=3)
         >>> d2 = dict(a=None,b=2,c=1, e=4)
-        >>> merge(d1, d2)
-        {'a': 1, 'c': 1, 'b': 2, 'e': 4, 'd': 3}
+        >>> sorted(merge(d1, d2).items())
+        [('a', 1), ('b', 2), ('c', 1), ('d', 3), ('e', 4)]
     """
     #d1.update(((k, v) for k, v in d2.iteritems() if v))
     #d1.update(((k, d2[k]) for k in d2 if d2[k]))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.