From 410444c815ef130eeaec156667fb17f53a60e41f Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Thu, 26 Jan 2017 15:38:41 -0700 Subject: [PATCH] fixing OrderedDict --- pipenv/cli.py | 13 ++++++------- pipenv/project.py | 6 ++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index e856e086..d215de18 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -102,7 +102,7 @@ def ensure_proper_casing(): casing_changed = False if section in p: - old_keys = [] + changed_values = [] # Replace each package with proper casing. for dep in p[section].keys(): @@ -115,14 +115,13 @@ def ensure_proper_casing(): # Mark casing as changed, if it did. casing_changed = True - old_keys.append(dep) + changed_values.append((new_casing, dep)) + for new, old in changed_values: # Replace old value with new value. - old_value = p[section][dep] - p[section][new_casing] = old_value - - for key in old_keys: - del p[section][key] + old_value = p[section][old] + p[section][new] = old_value + del p[section][old] return casing_changed diff --git a/pipenv/project.py b/pipenv/project.py index 3a9bfa6b..d56ca2a9 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -1,11 +1,9 @@ import os -try: - from collections import OrderedDict -except ImportError: - from ordereddict import OrderedDict import toml +from requests.compat import OrderedDict + from . import _pipfile as pipfile from .utils import format_toml, multi_split from .utils import convert_deps_from_pip, convert_deps_to_pip