From 22a277c80ecfe28ce21b7ce215ee38f25a702658 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 29 Jan 2019 15:56:34 -0800 Subject: fix bug in clean() resulting in many consistency check fails --- python/fatcat_tools/importers/common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'python/fatcat_tools/importers/common.py') 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&b') == 'a&b' assert clean('a&b') == 'a&b' -- cgit v1.2.3