From 0ef4b3a6c043328d42c493ecbd22f80bd870ad14 Mon Sep 17 00:00:00 2001 From: Roman Miroshnychenko Date: Tue, 9 Jan 2018 16:04:48 +0200 Subject: [PATCH] Use future.iterkeys to iterate over dict keys --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 55e5ca9..836cf11 100644 --- a/main.py +++ b/main.py @@ -14,6 +14,7 @@ from __future__ import unicode_literals # Monkey-patch standard libary names to enable Python 3-like behavior from future import standard_library standard_library.install_aliases() +from future.utils import iterkeys # The above strings provide compatibility layer for Python 2 # so the code can work in both versions. # In Python 3 they do nothing and can be safely removed. @@ -98,7 +99,7 @@ def get_categories(): :return: The list of video categories :rtype: types.GeneratorType """ - return VIDEOS.keys() + return iterkeys(VIDEOS) def get_videos(category):