RDFLib/rdflib — Issue #124: Graph.connected exception when passed empty graph
Author: gjhiggins
Created: 2012-02-20 08:33:17+00:00
State: open

gjhigg...@gmail.com, 2010-08-06T02:27:34.000Z

What steps will reproduce the problem?
1. from rdflib import Graph
2. g = Graph()
3. g.connected()

What is the expected output? What do you see instead?

Expected: False

Seen:

ValueError: empty range for randrange()

function connected in graph.py at line 828
visiting = [all_nodes[random.randrange(len(all_nodes))]]
function randrange in random.py at line 179
raise ValueError, "empty range for randrange()"
copy output

What version of the product are you using? On what operating system?

rdflib 3.0.0 Python 2.6.5, OS X Leopard

Please provide any additional information below.

Patch file atatched

Comment 1 by gromgull
This issue was closed by revision r1908.

Comment 2 by gromgull
This issue was closed by revision 75d1edd986e2.