From a7a3a572d830e39abfb6422cf5fbdaac965f92ae Mon Sep 17 00:00:00 2001 From: Vu Cong Tuan Date: Thu, 5 Jul 2018 10:35:31 +0700 Subject: [PATCH] Replace file() with open() for Python 3 compatibility The built-in named 'file' has been removed since Python 3.0 [1] This patch replaces it by 'open' which is the same under Python 2 and 3. [1] https://docs.python.org/release/3.0/whatsnew/3.0.html#builtins Change-Id: Ib2abbd0f6aea4423acae0c7dceccf1ef67c1caae --- fm-common/sources/fm_db_sync_event_suppression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fm-common/sources/fm_db_sync_event_suppression.py b/fm-common/sources/fm_db_sync_event_suppression.py index a859f6df..1f78cc73 100755 --- a/fm-common/sources/fm_db_sync_event_suppression.py +++ b/fm-common/sources/fm_db_sync_event_suppression.py @@ -105,7 +105,7 @@ EVENT_TYPES_FILE = get_events_yaml_filename() if not os.path.isfile(EVENT_TYPES_FILE): exit (-1) -stream = file(EVENT_TYPES_FILE, 'r') +stream = open(EVENT_TYPES_FILE, 'r') event_types = yaml.load(stream) for alarm_id in event_types: