Ticket #9714: trac_9714_review_review.patch

File trac_9714_review_review.patch, 795 bytes (added by Nathann Cohen, 11 years ago)
  • sage/graphs/graph.py

    # HG changeset patch
    # User Lukas Lansky <lansky@kam.mff.cuni.cz>
    # Date 1328023072 0
    # Node ID 6332dba56213796001499a05663dec45df015248
    # Parent  4716085f38099bac940e11131660cf94ca112aae
    trac 9714 -- Fixing the "loop" management in the Graph() constructor -- reviewer's reviewer's patch
    
    diff --git a/sage/graphs/graph.py b/sage/graphs/graph.py
    a b  
    10721072                    L = uniq(c.list())
    10731073                    L.sort()
    10741074
    1075                     if data.nrows() != len(desirable) - 1:
     1075                    if data.nrows() != (2 if len(NZ) == 2 else 1):
    10761076                        desirable = [-1, 0, 1] if len(NZ) == 2 else [0, 1]
    10771077                    else:
    10781078                        desirable = [-1, 1] if len(NZ) == 2 else [1]