summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/util.py
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2021-10-30 22:00:25 +0200
committerMike Bayer <mike_mp@zzzcomputing.com>2021-11-01 15:11:25 -0400
commit36e7aebd8d6faac77570403e99f9aa7b2330fa59 (patch)
treef45950f61a4b27f128518be52157021ca4f4e8f7 /lib/sqlalchemy/testing/util.py
parenta99ea884403de1e1f762e9b1eb635d7fc6ef8e6f (diff)
downloadsqlalchemy-36e7aebd8d6faac77570403e99f9aa7b2330fa59.tar.gz
First round of removal of python 2
References: #4600 Change-Id: I61e35bc93fe95610ae75b31c18a3282558cd4ffe
Diffstat (limited to 'lib/sqlalchemy/testing/util.py')
-rw-r--r--lib/sqlalchemy/testing/util.py24
1 files changed, 2 insertions, 22 deletions
diff --git a/lib/sqlalchemy/testing/util.py b/lib/sqlalchemy/testing/util.py
index a4d55a8f2..982e57517 100644
--- a/lib/sqlalchemy/testing/util.py
+++ b/lib/sqlalchemy/testing/util.py
@@ -27,7 +27,6 @@ from ..util import decorator
from ..util import defaultdict
from ..util import has_refcount_gc
from ..util import inspect_getfullargspec
-from ..util import py2k
if not has_refcount_gc:
@@ -47,14 +46,6 @@ else:
def picklers():
picklers = set()
- if py2k:
- try:
- import cPickle
-
- picklers.add(cPickle)
- except ImportError:
- pass
-
import pickle
picklers.add(pickle)
@@ -65,19 +56,8 @@ def picklers():
yield pickle_.loads, lambda d: pickle_.dumps(d, protocol)
-if py2k:
-
- def random_choices(population, k=1):
- pop = list(population)
- # lame but works :)
- random.shuffle(pop)
- return pop[0:k]
-
-
-else:
-
- def random_choices(population, k=1):
- return random.choices(population, k=k)
+def random_choices(population, k=1):
+ return random.choices(population, k=k)
def round_decimal(value, prec):