From 11acf2f51c5d6eaf6b0df010dca9dbda5d74941c Mon Sep 17 00:00:00 2001 From: DE0CH Date: Mon, 22 Jun 2020 14:12:21 +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 3e2cd15..176900b 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 or TypeError: + except (KeyError, TypeError): pass logging.info('finished ' + os.path.join(path, file_name)) geo_filtered_dict[os.path.join(path, file_name)] = True