walidazizi / rdflib

Automatically exported from code.google.com/p/rdflib
Other
0 stars 0 forks source link

Graph.connected exception when passed empty graph #133

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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

Original issue reported on code.google.com by gjhigg...@gmail.com on 6 Aug 2010 at 2:27

Attachments:

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r1908.

Original comment by gromgull on 28 Jan 2011 at 9:06

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 75d1edd986e2.

Original comment by gromgull on 30 Mar 2011 at 9:07