dgw / sopel-BombBot

Customized version of a custom version of a bomb module for Sopel
2 stars 1 forks source link

TypeError in .bomb under Python 3 #22

Closed dgw closed 8 years ago

dgw commented 8 years ago
<~Nala_Alan> .bomb Nezumikyun
<&Katou> TypeError: Population must be a sequence or set.
         For dicts, use list(d). (file "/usr/lib/python3.4/random.py",
         line 309, in sample)

This is happening in Python 3, obviously, so there's probably a cross compatibility issue—it works fine in Python 2.7.

dgw commented 8 years ago

Looks like this is probably related to the xrange() call, as Python 3 removed the old range() function and renamed xrange() to take its place.