gjhiggins/rdflib — Issue #132: Graph.connected exception when passed empty graph
Author: gjhiggins
Created: 2011-10-19 01:28:58+00:00
State: open

Originally filed by gjhigg...@gmail.com on 2010-08-06T02:27:34

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