summaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/importers/common.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-29 15:56:34 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-29 15:56:34 -0800
commit22a277c80ecfe28ce21b7ce215ee38f25a702658 (patch)
tree078018a3c20fa9254e33ac14ccd40ce3ef5dbc5e /python/fatcat_tools/importers/common.py
parent0720b0c77088e8402a0519da9de655576c74641b (diff)
downloadfatcat-22a277c80ecfe28ce21b7ce215ee38f25a702658.tar.gz
fatcat-22a277c80ecfe28ce21b7ce215ee38f25a702658.zip
fix bug in clean() resulting in many consistency check fails
Diffstat (limited to 'python/fatcat_tools/importers/common.py')
-rw-r--r--python/fatcat_tools/importers/common.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/fatcat_tools/importers/common.py b/python/fatcat_tools/importers/common.py
index 7c2ce400..32f7b4d5 100644
--- a/python/fatcat_tools/importers/common.py
+++ b/python/fatcat_tools/importers/common.py
@@ -28,7 +28,7 @@ def clean(thing, force_xml=False):
Also strips extra whitespace.
"""
if not thing:
- return thing
+ return None
fix_entities = 'auto'
if force_xml:
fix_entities = True
@@ -41,7 +41,8 @@ def clean(thing, force_xml=False):
def test_clean():
assert clean(None) == None
- assert clean('') == ''
+ assert clean('') == None
+ assert clean('1') == None
assert clean('123') == '123'
assert clean('a&amp;b') == 'a&b'
assert clean('<b>a&amp;b</b>') == '<b>a&amp;b</b>'