From c011c4ea1ee92155b4bd4ade239802b49de32988 Mon Sep 17 00:00:00 2001 From: Jackson Burns <33505528+JacksonBurns@users.noreply.github.com> Date: Fri, 10 Nov 2023 11:02:24 -0500 Subject: [PATCH] Fix Incompatibility with Python 3.12 According to the Python docs for the random module (https://docs.python.org/3/library/random.html#functions-for-integers): Changed in version 3.12: Automatic conversion of non-integer types is no longer supported. Calls such as randrange(10.0) and randrange(Fraction(10, 1)) now raise a TypeError. Python 3.12 will no longer automatically cast these floats to ints. --- padelpy/functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/padelpy/functions.py b/padelpy/functions.py index 6e0b2d9..67063e1 100644 --- a/padelpy/functions.py +++ b/padelpy/functions.py @@ -60,7 +60,7 @@ def from_smiles(smiles, maxruntime = maxruntime * 1000 timestamp = datetime.now().strftime("%Y%m%d%H%M%S%f")#[:-3] - filename = timestamp + str(random.randint(1e8,1e9)) + filename = timestamp + str(random.randint(int(1e8),int(1e9))) with open("{}.smi".format(filename), "w") as smi_file: if type(smiles) == str: