Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
65860700
Commit
65860700
authored
Dec 25, 2012
by
Tiago Peixoto
Browse files
Fix bug with python3 and xrange
parent
6e3cce61
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/__init__.py
View file @
65860700
...
...
@@ -76,6 +76,9 @@ Contents
"""
from
__future__
import
division
,
absolute_import
,
print_function
import
sys
if
sys
.
version_info
<
(
3
,):
range
=
xrange
__author__
=
"Tiago de Paula Peixoto <tiago@skewed.de>"
__copyright__
=
"Copyright 2007-2012 Tiago de Paula Peixoto"
...
...
@@ -1128,7 +1131,7 @@ class Graph(object):
return
v
else
:
pos
=
self
.
num_vertices
()
-
n
return
(
self
.
vertex
(
i
)
for
i
in
x
range
(
pos
,
pos
+
n
))
return
(
self
.
vertex
(
i
)
for
i
in
range
(
pos
,
pos
+
n
))
def
remove_vertex
(
self
,
vertex
):
"""Remove a vertex from the graph."""
...
...
src/graph_tool/search/__init__.py
View file @
65860700
...
...
@@ -75,13 +75,15 @@ Contents
"""
from
__future__
import
division
,
absolute_import
,
print_function
import
sys
if
sys
.
version_info
<
(
3
,):
range
=
xrange
from
..
dl_import
import
dl_import
dl_import
(
"from . import libgraph_tool_search"
)
from
..
import
_prop
,
_python_type
from
..
decorators
import
_wraps
import
sys
import
weakref
__all__
=
[
"bfs_search"
,
"BFSVisitor"
,
"dfs_search"
,
"DFSVisitor"
,
...
...
@@ -1445,7 +1447,7 @@ def astar_search(g, source, weight, visitor=AStarVisitor(),
self.visited = {}
def examine_vertex(self, u):
for i in
x
range(len(self.state[u])):
for i in range(len(self.state[u])):
nstate = list(self.state[u])
nstate[i] ^= 1
if tuple(nstate) in self.visited:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment