From 2288b04c9275db2d857691cc3d782efe4fa25997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Wed, 1 Mar 2017 18:14:44 +0100 Subject: [PATCH] Remove iteritems for py2/3 compatibility --- senpy/__init__.py | 4 +++- senpy/extensions.py | 2 -- senpy/plugins/conversion/centroids.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/senpy/__init__.py b/senpy/__init__.py index c9cfdf0..5c80f53 100644 --- a/senpy/__init__.py +++ b/senpy/__init__.py @@ -17,7 +17,9 @@ """ Sentiment analysis server in Python """ -from __future__ import print_function +from future import standard_library +standard_library.install_aliases() + from .version import __version__ import logging diff --git a/senpy/extensions.py b/senpy/extensions.py index c691ec8..5797c44 100644 --- a/senpy/extensions.py +++ b/senpy/extensions.py @@ -2,8 +2,6 @@ Main class for Senpy. It orchestrates plugin (de)activation and analysis. """ -from future import standard_library -standard_library.install_aliases() from .plugins import SentimentPlugin, SenpyPlugin from .models import Error, Entry, Results diff --git a/senpy/plugins/conversion/centroids.py b/senpy/plugins/conversion/centroids.py index 0d0b899..bb02a76 100644 --- a/senpy/plugins/conversion/centroids.py +++ b/senpy/plugins/conversion/centroids.py @@ -13,7 +13,7 @@ class CentroidConversion(EmotionConversionPlugin): for e in original.onyx__hasEmotion: category = e.onyx__hasEmotionCategory if category in self.centroids: - for dim, value in self.centroids[category].iteritems(): + for dim, value in self.centroids[category].items(): try: res[dim] += value except Exception: