Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
Networkx 2.0 compatibility fix by @Erotemic (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewels authored and gtaylor committed Aug 21, 2017
1 parent aaa425a commit 30bd9cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion colormath/color_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ def get_conversion_path(self, start_type, target_type):

def add_type_conversion(self, start_type, target_type, conversion_function):
super(GraphConversionManager, self).add_type_conversion(start_type, target_type, conversion_function)
self.conversion_graph.add_edge(start_type, target_type, {'conversion_function': conversion_function})
if networkx.__version__.startswith('2'):
self.conversion_graph.add_edge(start_type, target_type, conversion_function=conversion_function)
else:
self.conversion_graph.add_edge(start_type, target_type, {'conversion_function': conversion_function})


class DummyConversionManager(ConversionManager):
Expand Down

0 comments on commit 30bd9cb

Please sign in to comment.