source: peerreviewplugin/trunk/codereview/compat.py

Last change on this file was 18251, checked in by Cinc-th, 2 years ago

PeerReviewPlugin: fixes for sort() and iteritems().

Refs #14005

File size: 541 bytes
RevLine 
[18251]1# -*- coding: utf-8 -*-
2#
3# Copyright (C) 2021 Cinc
4# All rights reserved.
5#
6# This software is licensed as described in the file COPYING.txt, which
7# you should have received as part of this distribution.
8#
9
10try:
11    dict.iteritems
12except AttributeError:
13    # Python 3
14    def itervalues(d):
15        return iter(d.values())
16    def iteritems(d):
17        return iter(d.items())
18    is_py3 = True
19else:
20    # Python 2
21    is_py3 = False
22    def itervalues(d):
23        return d.itervalues()
24    def iteritems(d):
25        return d.iteritems()
Note: See TracBrowser for help on using the repository browser.