Skip to content

Commit

Permalink
Fix Incompatibility with Python 3.12
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JacksonBurns authored Nov 10, 2023
1 parent 6b992b4 commit c011c4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion padelpy/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c011c4e

Please sign in to comment.