From b31f288dc0a9663d5088ab065abf14d3a9c9f471 Mon Sep 17 00:00:00 2001 From: Rajat Mittal Date: Sun, 26 May 2019 16:31:02 +0800 Subject: [PATCH] added one line --- src/sage/graphs/base/c_graph.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sage/graphs/base/c_graph.pyx b/src/sage/graphs/base/c_graph.pyx index 89972d1f7cc..02c64ecf992 100644 --- a/src/sage/graphs/base/c_graph.pyx +++ b/src/sage/graphs/base/c_graph.pyx @@ -2195,7 +2195,8 @@ cdef class CGraphBackend(GenericGraphBackend): sage: G.distance(0, 5, by_weight=true) 3 """ - + if exclude_vertices and (x in exclude_vertices or y in exclude_vertices): + raise LookupError("No path between %s and %s" % (x, y)) if x == y: return 0