diff options
-rw-r--r-- | .travis.yml | 4 | ||||
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | dbus/_compat.py | 4 | ||||
-rw-r--r-- | doc/PY3PORT.txt | 4 | ||||
-rwxr-xr-x | test/test-standalone.py | 46 |
6 files changed, 21 insertions, 44 deletions
diff --git a/.travis.yml b/.travis.yml index 5d357dd..a6570db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,12 +48,10 @@ install: http://httpredir.debian.org/debian/pool/main/a/autoconf-archive/autoconf-archive_20150925-1_all.deb - 'sudo dpkg -i autoconf-archive_*_all.deb' - 'rm autoconf-archive_*_all.deb' - # use tap.py 1.9 for virtualenvs until we drop support for Python 2.6 - - test -n "$dbus_ci_system_python" || pip install tap.py==1.9 + - test -n "$dbus_ci_system_python" || pip install tap.py - test -z "$dbus_ci_system_python" || deactivate - test -z "$dbus_ci_system_python" || pip install --user tap.py python: - - "2.6" - "2.7" - "3.2" - "3.3" @@ -3,8 +3,9 @@ D-Bus Python Bindings 1.2.6 (UNRELEASED) Dependencies: -• Most unit tests now require the tap.py module from PyPI. Use version 1.9 - or older if you are still running Python 2.6. +• Python ≥ 2.7 is now required. Python 2.6 security support ended + in 2013, so if you are still using it, please upgrade. +• Most unit tests now require the tap.py module from PyPI. D-Bus Python Bindings 1.2.4 (2016-03-06) ======================================== diff --git a/configure.ac b/configure.ac index 7b0449d..fd8ae2a 100644 --- a/configure.ac +++ b/configure.ac @@ -63,7 +63,7 @@ AC_PROG_MKDIR_P AC_PROG_AWK AC_REQUIRE_AUX_FILE([tap-driver.sh]) -AM_PATH_PYTHON([2.6]) +AM_PATH_PYTHON([2.7]) AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)]) diff --git a/dbus/_compat.py b/dbus/_compat.py index 45a0c97..62bbe28 100644 --- a/dbus/_compat.py +++ b/dbus/_compat.py @@ -2,7 +2,5 @@ import sys -# In Python 2.6, sys.version_info is not a namedtuple, so we can't use -# sys.version_info.major. -is_py3 = (sys.version_info[0] == 3) +is_py3 = (sys.version_info.major == 3) is_py2 = not is_py3 diff --git a/doc/PY3PORT.txt b/doc/PY3PORT.txt index 31bb9d8..a028153 100644 --- a/doc/PY3PORT.txt +++ b/doc/PY3PORT.txt @@ -34,7 +34,7 @@ You've got some dbus-python code that works great in Python 2. This branch should generally allow your existing Python 2 code to continue to work unchanged. There are a few changes you'll notice in Python 2 though: - - The minimum supported Python 2 version is 2.6. + - The minimum supported Python 2 version is 2.7. - All object reprs are unicodes. This change was made because it greatly simplifies the implementation and cross-compatibility with Python 3. - Some exception strings have changed. @@ -209,8 +209,6 @@ any return path. - `isSequenceType()` is gone in Python 3, so I use a different idiom there. - `__next__()` vs. `next()` - `PyUnicode_FromFormat()` `%V` flag is a clever hack! - - `sys.version_info` is a tuple in Python 2.6, not a namedtuple. i.e. there - is no `sys.version_info.major` - `PyArg_Parse()`: No 'y' code in Python 2; in Python 3, no equivalent of 'z' for bytes objects. diff --git a/test/test-standalone.py b/test/test-standalone.py index 2f6121e..c68b1db 100755 --- a/test/test-standalone.py +++ b/test/test-standalone.py @@ -89,22 +89,8 @@ def uni(x): return chr(x) else: return unichr(x) - elif is_py3: - return struct.pack('>I', x).decode('utf_32_be') - else: - # Python 2.6 didn't accept unicode format strings - return struct.pack(b'>I', x).decode('utf_32_be') - -def utf8(*xs): - """Return a bytestring containing the given UTF-8 bytes. - - utf8(0xc2, 0xa3) == b'\\xc2\\xa3' on Python versions that - allow bytestring literals (but some Python 2 versions do not). - """ - if is_py3: - return bytes(xs) else: - return str('').join(map(chr, xs)) + return struct.pack('>I', x).decode('utf_32_be') class TestTypes(unittest.TestCase): @@ -470,7 +456,7 @@ class TestMessageMarshalling(unittest.TestCase): for bad in [ uni(0xD800), - utf8(0xed, 0xa0, 0x80), + b'\xed\xa0\x80', ]: s = SignalMessage('/', 'foo.bar', 'baz') try: @@ -494,27 +480,27 @@ class TestMessageMarshalling(unittest.TestCase): s.append(good.encode('utf-8'), signature='s') for noncharacter in [ uni(0xFDD0), - utf8(0xef, 0xb7, 0x90), + b'\xef\xb7\x90', uni(0xFDD7), - utf8(0xef, 0xb7, 0x97), + b'\xef\xb7\x97', uni(0xFDEF), - utf8(0xef, 0xb7, 0xaf), + b'\xef\xb7\xaf', uni(0xFFFE), - utf8(0xef, 0xbf, 0xbe), + b'\xef\xbf\xbe', uni(0xFFFF), - utf8(0xef, 0xbf, 0xbf), + b'\xef\xbf\xbf', uni(0x0001FFFE), - utf8(0xf0, 0x9f, 0xbf, 0xbe), + b'\xf0\x9f\xbf\xbe', uni(0x0001FFFF), - utf8(0xf0, 0x9f, 0xbf, 0xbf), + b'\xf0\x9f\xbf\xbf', uni(0x0007FFFE), - utf8(0xf1, 0xbf, 0xbf, 0xbe), + b'\xf1\xbf\xbf\xbe', uni(0x0007FFFF), - utf8(0xf1, 0xbf, 0xbf, 0xbf), + b'\xf1\xbf\xbf\xbf', uni(0x0010FFFE), - utf8(0xf4, 0x8f, 0xbf, 0xbe), + b'\xf4\x8f\xbf\xbe', uni(0x0010FFFF), - utf8(0xf4, 0x8f, 0xbf, 0xbf), + b'\xf4\x8f\xbf\xbf', ]: s = SignalMessage('/', 'foo.bar', 'baz') try: @@ -557,10 +543,6 @@ class TestVersion(unittest.TestCase): self.assertLess(dbus.__version__, '9') if __name__ == '__main__': - # Python 2.6 doesn't accept a `verbosity` keyword. - kwargs = {} - if sys.version_info[:2] >= (2, 7): - kwargs['verbosity'] = 2 runner = TAPTestRunner() runner.set_stream(True) - unittest.main(testRunner=runner, **kwargs) + unittest.main(testRunner=runner, verbosity=2) |