diff options
author | Ian Delaney <idella4@gentoo.org> | 2013-05-03 05:03:34 +0000 |
---|---|---|
committer | Ian Delaney <idella4@gentoo.org> | 2013-05-03 05:03:34 +0000 |
commit | d1d9234414cb1a1a277852ad42b57a46c79e59b9 (patch) | |
tree | 3cf8d028ba17ba9bef8a2a9a0e700cc0dd283145 | |
parent | Cleanup. (diff) | |
download | gentoo-2-d1d9234414cb1a1a277852ad42b57a46c79e59b9.tar.gz gentoo-2-d1d9234414cb1a1a277852ad42b57a46c79e59b9.tar.bz2 gentoo-2-d1d9234414cb1a1a277852ad42b57a46c79e59b9.zip |
on closer review dropped py2.5; added py3 support & matching patch prepared by 'solj' in Bug #464766, closes same Bug by 'solj'
(Portage version: 2.1.11.62/cvs/Linux x86_64, signed Manifest commit with key 0xB8072B0D)
-rw-r--r-- | dev-python/lockfile/ChangeLog | 7 | ||||
-rw-r--r-- | dev-python/lockfile/files/py3-support.patch | 107 | ||||
-rw-r--r-- | dev-python/lockfile/lockfile-0.9.1-r1.ebuild | 11 |
3 files changed, 120 insertions, 5 deletions
diff --git a/dev-python/lockfile/ChangeLog b/dev-python/lockfile/ChangeLog index 5c3b12378e0b..1ef50bfd76e1 100644 --- a/dev-python/lockfile/ChangeLog +++ b/dev-python/lockfile/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for dev-python/lockfile # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/lockfile/ChangeLog,v 1.14 2013/05/02 05:25:18 idella4 Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/lockfile/ChangeLog,v 1.15 2013/05/03 05:03:34 idella4 Exp $ + + 03 May 2013; Ian Delaney <idella4@gentoo.org> +files/py3-support.patch, + lockfile-0.9.1-r1.ebuild: + on closer review dropped py2.5; added py3 support & matching patch prepared by + 'solj' in Bug #464766, closes same Bug by 'solj' *lockfile-0.9.1-r1 (02 May 2013) diff --git a/dev-python/lockfile/files/py3-support.patch b/dev-python/lockfile/files/py3-support.patch new file mode 100644 index 000000000000..ca6349a75a20 --- /dev/null +++ b/dev-python/lockfile/files/py3-support.patch @@ -0,0 +1,107 @@ +# https://github.com/smontanaro/pylockfile/commit/379fa0b6131995f96f5bd048906fc0bd3c2527f7 +# https://github.com/smontanaro/pylockfile/commit/eeead7d35e9a97b457b90edd241fd031df68d57b +# https://github.com/smontanaro/pylockfile/commit/bf2627a5b9f83e1bbcf1b5030a693acb6236a211 +--- a/lockfile/__init__.py ++++ b/lockfile/__init__.py +@@ -1,4 +1,3 @@ +- + """ + lockfile.py - Platform-independent advisory file locks. + +@@ -50,6 +49,8 @@ Exceptions: + NotMyLock - File was locked but not by the current thread/process + """ + ++from __future__ import absolute_import ++ + import sys + import socket + import os +@@ -257,7 +258,7 @@ def LinkFileLock(*args, **kwds): + Do not use in new code. Instead, import LinkLockFile from the + lockfile.linklockfile module. + """ +- import linklockfile ++ from . import linklockfile + return _fl_helper(linklockfile.LinkLockFile, "lockfile.linklockfile", + *args, **kwds) + +@@ -267,7 +268,7 @@ def MkdirFileLock(*args, **kwds): + Do not use in new code. Instead, import MkdirLockFile from the + lockfile.mkdirlockfile module. + """ +- import mkdirlockfile ++ from . import mkdirlockfile + return _fl_helper(mkdirlockfile.MkdirLockFile, "lockfile.mkdirlockfile", + *args, **kwds) + +@@ -277,7 +278,7 @@ def SQLiteFileLock(*args, **kwds): + Do not use in new code. Instead, import SQLiteLockFile from the + lockfile.mkdirlockfile module. + """ +- import sqlitelockfile ++ from . import sqlitelockfile + return _fl_helper(sqlitelockfile.SQLiteLockFile, "lockfile.sqlitelockfile", + *args, **kwds) + +@@ -306,10 +307,10 @@ def locked(path, timeout=None): + return decor + + if hasattr(os, "link"): +- import linklockfile as _llf ++ from . import linklockfile as _llf + LockFile = _llf.LinkLockFile + else: +- import mkdirlockfile as _mlf ++ from . import mkdirlockfile as _mlf + LockFile = _mlf.MkdirLockFile + + FileLock = LockFile +diff --git a/lockfile/pidlockfile.py b/lockfile/pidlockfile.py +index 3fc8f63..a965ba8 100644 +--- a/lockfile/pidlockfile.py ++++ b/lockfile/pidlockfile.py +@@ -78,7 +78,7 @@ class PIDLockFile(LockBase): + while True: + try: + write_pid_to_pidfile(self.path) +- except OSError, exc: ++ except OSError as exc: + if exc.errno == errno.EEXIST: + # The lock creation failed. Maybe sleep a bit. + if timeout is not None and time.time() > end_time: +@@ -159,7 +159,7 @@ def write_pid_to_pidfile(pidfile_path): + + """ + open_flags = (os.O_CREAT | os.O_EXCL | os.O_WRONLY) +- open_mode = 0644 ++ open_mode = 0o644 + pidfile_fd = os.open(pidfile_path, open_flags, open_mode) + pidfile = os.fdopen(pidfile_fd, 'w') + +@@ -186,7 +186,7 @@ def remove_existing_pidfile(pidfile_path): + """ + try: + os.remove(pidfile_path) +- except OSError, exc: ++ except OSError as exc: + if exc.errno == errno.ENOENT: + pass + else: +diff --git a/lockfile/sqlitelockfile.py b/lockfile/sqlitelockfile.py +index ec75490..d596229 100644 +--- a/lockfile/sqlitelockfile.py ++++ b/lockfile/sqlitelockfile.py +@@ -3,6 +3,11 @@ from __future__ import absolute_import, division + import time + import os + ++try: ++ unicode ++except NameError: ++ unicode = str ++ + from . import LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked + + class SQLiteLockFile(LockBase): + diff --git a/dev-python/lockfile/lockfile-0.9.1-r1.ebuild b/dev-python/lockfile/lockfile-0.9.1-r1.ebuild index 502dcafefbfb..06da1c7a53aa 100644 --- a/dev-python/lockfile/lockfile-0.9.1-r1.ebuild +++ b/dev-python/lockfile/lockfile-0.9.1-r1.ebuild @@ -1,9 +1,10 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/lockfile/lockfile-0.9.1-r1.ebuild,v 1.1 2013/05/02 05:25:18 idella4 Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/lockfile/lockfile-0.9.1-r1.ebuild,v 1.2 2013/05/03 05:03:34 idella4 Exp $ EAPI=5 -PYTHON_COMPAT=( python{2_5,2_6,2_7} pypy{1_9,2_0} ) +# py2.5 dropped; Test file reveals py2.5 can't support a core file +PYTHON_COMPAT=( python{2_6,2_7,3_1,3_2,3_3} pypy{1_9,2_0} ) inherit distutils-r1 @@ -23,6 +24,8 @@ RDEPEND="" DOCS=( ACKS README RELEASE-NOTES ) +PATCHES=( "${FILESDIR}"/py3-support.patch ) + python_compile_all() { if use doc; then einfo "Generation of documentation" @@ -31,8 +34,8 @@ python_compile_all() { } python_test() { -# "${PYTHON}" test/test_lockfile.py || die - nosetests || die + # "${PYTHON}" test/test_lockfile.py yeilds no informative coverage output + nosetests || die "test_lockfile failed under ${EPYTHON}" } python_install_all() { |