File: five.py

package info (click to toggle)
python-pyvmomi 9.0.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,372 kB
  • sloc: python: 18,622; xml: 77; makefile: 3
file content (43 lines) | stat: -rw-r--r-- 871 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Copyright (c) 2025 Broadcom. All Rights Reserved.
# The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.

import sys

pyMajor = sys.version_info[0]
pyMinor = sys.version_info[1]

PY3 = pyMajor >= 3

if PY3:
    from http.client import (HTTPConnection, HTTPSConnection)
    from urllib.parse import urlparse

    binary_type = bytes
    str_type = str
    text_type = str

    def iteritems(d):
        return d.items()

    def itervalues(d):
        return d.values()

else:
    from httplib import (HTTPConnection, HTTPSConnection)
    from urlparse import urlparse

    binary_type = str
    str_type = basestring
    text_type = unicode

    def iteritems(d):
        return d.iteritems()

    def itervalues(d):
        return d.itervalues()

    import itertools  # noqa: E402

    map = itertools.imap
    range = xrange
    zip = itertools.izip