Skip to content

Commit

Permalink
Fix '--freeze' flag
Browse files Browse the repository at this point in the history
This flag was broken after PR #154 was merged.
  • Loading branch information
naiquevin committed Jan 2, 2022
1 parent bc143a7 commit 1a51d65
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pipdeptree.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
from collections import Mapping

from pip._vendor import pkg_resources
try:
from pip._internal.operations.freeze import FrozenRequirement
except ImportError:
from pip import FrozenRequirement
# inline:
# from graphviz import Digraph
# from graphviz import parameters
Expand Down Expand Up @@ -119,7 +123,8 @@ def render(self, parent=None, frozen=False):

@staticmethod
def frozen_repr(obj):
return str(obj.as_requirement())
fr = frozen_req_from_dist(obj)
return str(fr).strip()

def __getattr__(self, key):
return getattr(self._obj, key)
Expand Down

0 comments on commit 1a51d65

Please sign in to comment.