From 71f9280576321488f87c286b61a40d6b6ab7fcea Mon Sep 17 00:00:00 2001 From: Pierre-Alain TORET Date: Sat, 18 Apr 2020 12:35:32 +0200 Subject: [PATCH] change Python iteritems by items --- plugins/tor/tor_ | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/tor/tor_ b/plugins/tor/tor_ index 066ca897..7029cb9c 100755 --- a/plugins/tor/tor_ +++ b/plugins/tor/tor_ @@ -134,11 +134,11 @@ class TorPlugin(object): @staticmethod def conf_from_dict(graph, labels): # header - for key, val in graph.iteritems(): + for key, val in graph.items(): print('graph_{} {}'.format(key, val)) # values - for label, attributes in labels.iteritems(): - for key, val in attributes.iteritems(): + for label, attributes in labels.items(): + for key, val in attributes.items(): print('{}.{} {}'.format(label, key, val)) @staticmethod @@ -253,7 +253,7 @@ class TorConnections(TorPlugin): states = dict((state, 0) for state in stem.ORStatus) for connection in connections: states[connection.rsplit(None, 1)[-1]] += 1 - for state, count in states.iteritems(): + for state, count in states.items(): print('{}.value {}'.format(state.lower(), count)) except stem.connection.AuthenticationFailure as e: print('Authentication failed ({})'.format(e))