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

Commit

Permalink
trac #26478: fix six import in graph_input.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoudert committed Oct 13, 2018
1 parent 90f89b0 commit 93ea7bd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/sage/graphs/graph_input.py
Expand Up @@ -19,7 +19,7 @@
"""
from __future__ import absolute_import, division
import six
from six import iteritems
from six.moves import range


Expand Down Expand Up @@ -425,9 +425,9 @@ def from_dict_of_dicts(G, M, loops=False, multiedges=False, weighted=False, conv
raise ValueError("input dict must be a consistent format")

if not loops:
if any(u in neighb for u,neighb in six.iteritems(M)):
if any(u in neighb for u,neighb in iteritems(M)):
if loops is False:
u = next(u for u,neighb in six.iteritems(M) if u in neighb)
u = next(u for u,neighb in iteritems(M) if u in neighb)
raise ValueError("the graph was built with loops=False but input M has a loop at {}".format(u))
loops = True
if loops is None:
Expand Down Expand Up @@ -492,9 +492,9 @@ def from_dict_of_lists(G, D, loops=False, multiedges=False, weighted=False):
"""
verts = set().union(D.keys(), *D.values())
if not loops:
if any(u in neighb for u, neighb in six.iteritems(D)):
if any(u in neighb for u, neighb in iteritems(D)):
if loops is False:
u = next(u for u, neighb in six.iteritems(M) if u in neighb)
u = next(u for u, neighb in iteritems(D) if u in neighb)
raise ValueError("the graph was built with loops=False but input D has a loop at {}".format(u))
loops = True
if loops is None:
Expand Down

0 comments on commit 93ea7bd

Please sign in to comment.