From 2216f481d2ae05fac644fde3b759a215465f00b9 Mon Sep 17 00:00:00 2001 From: DE0CH Date: Mon, 22 Jun 2020 14:10:28 +0800 Subject: [PATCH] optimised geo_filter.py --- geo_filter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geo_filter.py b/geo_filter.py index f1a7cd4..3e2cd15 100644 --- a/geo_filter.py +++ b/geo_filter.py @@ -29,7 +29,7 @@ def process_files(path, file_name, geo_filtered_dict): try: if tweet['place']['country_code']: out_file.write(line) - except KeyError: + except KeyError or TypeError: pass logging.info('finished ' + os.path.join(path, file_name)) geo_filtered_dict[os.path.join(path, file_name)] = True