From fd0c477192283f9a9a9f11f2426c9a09e0696523 Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Tue, 17 Jun 2014 23:00:42 -0700 Subject: [PATCH] Restore Python 2.6 compatibility c70525bb8430d7fa7de5919f0ef7d489428f7154 broke Python 2.6 compatibility by using a dict comprehension, which is a Python 2.7 feature. I replaced it with calling dict with a generator expression, which looks almost as good and it works in Python 2.6. --- tests/test_pipdeptree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_pipdeptree.py b/tests/test_pipdeptree.py index b8fd3f8..f86ddd8 100644 --- a/tests/test_pipdeptree.py +++ b/tests/test_pipdeptree.py @@ -15,8 +15,8 @@ def venv_fixture(pickle_file): """ with open(pickle_file, 'rb') as f: pkgs = pickle.load(f) - pkg_index = {p.key: p for p in pkgs} - req_map = {p: p.requires() for p in pkgs} + pkg_index = dict((p.key, p) for p in pkgs) + req_map = dict((p, p.requires()) for p in pkgs) return pkgs, pkg_index, req_map