File: compat.py

package info (click to toggle)
python-user-agents 2.2.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 156 kB
  • sloc: python: 489; makefile: 5
file content (14 lines) | stat: -rw-r--r-- 243 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import sys

PY3 = sys.version_info[0] == 3

if PY3:
    string_types = str

    def iteritems(d, **kw):
        return iter(d.items(**kw))
else:
    string_types = basestring

    def iteritems(d, **kw):
        return iter(d.iteritems(**kw))