From 7eef63c1195ff0e03b55b2ebd1d19bec752923f9 Mon Sep 17 00:00:00 2001 From: Allard Stijnman Date: Thu, 24 Mar 2016 15:53:43 +0100 Subject: [PATCH] Update: more lenient string check --- .gitignore | 2 +- .idea/.name | 1 - .idea/encodings.xml | 6 - .idea/freemail.iml | 11 - .idea/inspectionProfiles/Project_Default.xml | 28 - .../inspectionProfiles/profiles_settings.xml | 7 - .idea/misc.xml | 14 - .idea/modules.xml | 8 - .idea/vcs.xml | 6 - .idea/workspace.xml | 600 ------------------ freemail/__init__.py | 8 +- setup.py | 2 +- 12 files changed, 8 insertions(+), 685 deletions(-) delete mode 100644 .idea/.name delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/freemail.iml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.gitignore b/.gitignore index 30f7de0..7bc225f 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,7 @@ node_modules # Users Environment Variables .lock-wscript -.idea +.idea/* *.pyc *.egg-info dist diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 86ed68b..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -freemail \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/freemail.iml b/.idea/freemail.iml deleted file mode 100644 index 6711606..0000000 --- a/.idea/freemail.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index f117667..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 3b31283..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index f3001dc..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index f464cf8..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 96f82c2..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,600 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1458748151073 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/freemail/__init__.py b/freemail/__init__.py index d91dbf4..c6dbbfe 100644 --- a/freemail/__init__.py +++ b/freemail/__init__.py @@ -8,7 +8,9 @@ disp_file = os.path.join(__location__, './data/disposable.txt') def is_free(email_address): - if not isinstance(email_address, str): + try: + email_address = str(email_address) + except: raise TypeError('email must be a string') with open(free_file, 'r') as free, open(disp_file, 'r') as disposable: @@ -19,7 +21,9 @@ def is_free(email_address): def is_disposable(email_address): - if not isinstance(email_address, str): + try: + email_address = str(email_address) + except: raise TypeError('email must be a string') with open(disp_file, 'r') as disposable: diff --git a/setup.py b/setup.py index de4b9de..9390e82 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ setup( # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='1.2.15', + version='1.2.16', description='A database of free and disposable email domains', long_description=long_description,