Skip to content

Commit b6438c0

Browse files
committed
Fixed seed_type value checking
1 parent a6b4bd7 commit b6438c0

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

dist/randstr-random-1.1.2.tar.gz

-2.93 KB
Binary file not shown.

dist/randstr-random-1.1.3.tar.gz

2.93 KB
Binary file not shown.

randstr.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ def generate(string_length, seed_type):
4242
if (type(seed_type) is not str):
4343
raise TypeError("The seed_type argument isn't a string!")
4444

45-
if (seed_type.lower() != "al" and seed_type.lower() != "au" and seed_type.lower() != "dig" and seed_type.lower() != "spec" and seed_type.lower() != "ad" and seed_type.lower() != "ads"):
45+
seed_type = seed_type.lower()
46+
47+
if (seed_type != "al" and seed_type != "au" and seed_type != "dig" and seed_type != "spec" and seed_type != "ad" and seed_type != "ads"):
4648
raise ValueError("The seed_type argument must one of the following strings - 'al', 'au', 'dig', 'spec', 'ad', 'ads' ")
4749

4850
randstring = str("")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='randstr-random',
8-
version='1.1.2',
8+
version='1.1.3',
99
py_modules=['randstr'],
1010
license='MIT',
1111
description='Python package for generating strings with random characters.',

0 commit comments

Comments
 (0)