From: Philipp Gesang Date: Mon, 31 Oct 2016 16:44:42 +0000 (+0100) Subject: avoid crash in test helper due to fp division X-Git-Tag: v2.2~8^2~9 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=b4e1cb725969051056e8eb330f3da4264dbcd7ab;p=python-delta-tar avoid crash in test helper due to fp division As a matter of fact, ``randomint()`` accepts only int-ishly typed values, not floats. Consequently, integer division is the way to go. --- diff --git a/testing/create_pseudo_random_files.py b/testing/create_pseudo_random_files.py index d5a12cb..953afcc 100755 --- a/testing/create_pseudo_random_files.py +++ b/testing/create_pseudo_random_files.py @@ -120,7 +120,7 @@ def get_files_per_folder(nfile, ndir, distribute_files): if (f_per_dir > 0): var = max(1, int(f_per_dir - f_per_dir * distribute_files / 100)) files += random.randint(f_per_dir - var, f_per_dir + var) - var = f_remainder - f_remainder * distribute_files / 100 + var = f_remainder - f_remainder * distribute_files // 100 files += random.randint(f_remainder - var, f_remainder + var) aux_files -= files if (aux_files <= 0):