Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit f5bc021

Browse files
committed
fix deprecation
1 parent 020bd59 commit f5bc021

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sage/graphs/generators/random.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ def growing_subtrees(T, k):
868868
sage: len(S)
869869
10
870870
"""
871-
from sage.misc.prandom import sample
871+
from sage.misc.prandom import choice
872872
n = T.order()
873873
S = []
874874
for _ in range(n):
@@ -881,7 +881,7 @@ def growing_subtrees(T, k):
881881
neighbors = set(T.neighbor_iterator(x))
882882
for j in range(ki - 1):
883883
# Select a random neighbor z outside of Ti and add it to Ti
884-
z = sample(neighbors, 1)[0]
884+
z = choice(tuple(neighbors))
885885
Ti.add(z)
886886
neighbors.update(y for y in T.neighbor_iterator(z) if y not in Ti)
887887
Vi = frozenset(Ti)

0 commit comments

Comments
 (0)