[Python-modules-commits] [billiard] 01/01: Import billiard_3.3.0.23.orig.tar.gz

Michael Fladischer fladi at moszumanska.debian.org
Thu Mar 31 09:32:12 UTC 2016


This is an automated email from the git hooks/post-receive script.

fladi pushed a commit to branch upstream
in repository billiard.

commit c1f1e19192429a42452c33d84a178d104bc58a5c
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date:   Thu Mar 31 11:00:40 2016 +0200

    Import billiard_3.3.0.23.orig.tar.gz
---
 CHANGES.txt                     | 10 ++++++
 Modules/_billiard/connection.h  | 75 +++++++++++++++++++++++++++--------------
 PKG-INFO                        | 14 ++++++--
 README.rst                      |  2 +-
 billiard.egg-info/PKG-INFO      | 14 ++++++--
 billiard.egg-info/top_level.txt |  4 +--
 billiard/__init__.py            |  2 +-
 billiard/einfo.py               | 36 ++++++++++++++++----
 billiard/five.py                |  8 +++--
 billiard/forking.py             |  2 +-
 10 files changed, 124 insertions(+), 43 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index aacdffe..e954647 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,13 @@
+3.3.0.23 - 2016-03-03
+---------------------
+
+- ExceptionInfo: Adds tb_lasti and other missing traceback fields
+  (Issue #180).
+
+- monotonic: Now makes sure ctypes is available.
+
+- PipeConnection: Make sure the pipe is not closed multiple times.
+
 3.3.0.22 - 2015-12-08
 ---------------------
 
diff --git a/Modules/_billiard/connection.h b/Modules/_billiard/connection.h
index eb67562..6f3958d 100644
--- a/Modules/_billiard/connection.h
+++ b/Modules/_billiard/connection.h
@@ -85,12 +85,15 @@ Billiard_connection_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 static void
 Billiard_connection_dealloc(BilliardConnectionObject* self)
 {
+    HANDLE handle = self->handle;
+
     if (self->weakreflist != NULL)
         PyObject_ClearWeakRefs((PyObject*)self);
 
-    if (self->handle != INVALID_HANDLE_VALUE) {
+    if (handle != INVALID_HANDLE_VALUE) {
+        self->handle = INVALID_HANDLE_VALUE;
         Py_BEGIN_ALLOW_THREADS
-        CLOSE(self->handle);
+        CLOSE(handle);
         Py_END_ALLOW_THREADS
     }
     PyObject_Del(self);
@@ -154,6 +157,7 @@ Billiard_connection_recvbytes(BilliardConnectionObject *self, PyObject *args)
     char *freeme = NULL;
     Py_ssize_t res, maxlength = PY_SSIZE_T_MAX;
     PyObject *result = NULL;
+    HANDLE handle;
 
     if (!PyArg_ParseTuple(args, "|" F_PY_SSIZE_T, &maxlength))
         return NULL;
@@ -171,10 +175,13 @@ Billiard_connection_recvbytes(BilliardConnectionObject *self, PyObject *args)
     if (res < 0) {
         if (res == MP_BAD_MESSAGE_LENGTH) {
             if ((self->flags & WRITABLE) == 0) {
-                Py_BEGIN_ALLOW_THREADS
-                CLOSE(self->handle);
-                Py_END_ALLOW_THREADS
-                self->handle = INVALID_HANDLE_VALUE;
+                handle = self->handle;
+                if (handle != INVALID_HANDLE_VALUE) {
+                    self->handle = INVALID_HANDLE_VALUE;
+                    Py_BEGIN_ALLOW_THREADS
+                    CLOSE(handle);
+                    Py_END_ALLOW_THREADS
+                }
             } else {
                 self->flags = WRITABLE;
             }
@@ -200,6 +207,7 @@ Billiard_connection_recvbytes_into(BilliardConnectionObject *self, PyObject *arg
     Py_ssize_t res, length, offset = 0;
     PyObject *result = NULL;
     Py_buffer pbuf;
+    HANDLE handle;
 
     CHECK_READABLE(self);
 
@@ -226,10 +234,13 @@ Billiard_connection_recvbytes_into(BilliardConnectionObject *self, PyObject *arg
     if (res < 0) {
         if (res == MP_BAD_MESSAGE_LENGTH) {
             if ((self->flags & WRITABLE) == 0) {
-                Py_BEGIN_ALLOW_THREADS
-                CLOSE(self->handle);
-                Py_END_ALLOW_THREADS
-                self->handle = INVALID_HANDLE_VALUE;
+                handle = self->handle;
+                if (handle != INVALID_HANDLE_VALUE) {
+                    self->handle = INVALID_HANDLE_VALUE;
+                    Py_BEGIN_ALLOW_THREADS
+                    CLOSE(handle);
+                    Py_END_ALLOW_THREADS
+                }
             } else {
                 self->flags = WRITABLE;
             }
@@ -267,6 +278,7 @@ Billiard_connection_recvbytes_into(BilliardConnectionObject *self, PyObject *arg
     char *freeme = NULL, *buffer = NULL;
     Py_ssize_t length = 0, res, offset = 0;
     PyObject *result = NULL;
+    HANDLE handle;
 
     CHECK_READABLE(self);
 
@@ -289,10 +301,13 @@ Billiard_connection_recvbytes_into(BilliardConnectionObject *self, PyObject *arg
     if (res < 0) {
        if (res == MP_BAD_MESSAGE_LENGTH) {
             if ((self->flags & WRITABLE) == 0) {
-                Py_BEGIN_ALLOW_THREADS
-                CLOSE(self->handle);
-                Py_END_ALLOW_THREADS
-                self->handle = INVALID_HANDLE_VALUE;
+                handle = self->handle;
+                if (handle != INVALID_HANDLE_VALUE) {
+                    self->handle = INVALID_HANDLE_VALUE;
+                    Py_BEGIN_ALLOW_THREADS
+                    CLOSE(handle);
+                    Py_END_ALLOW_THREADS
+                }
             } else {
                 self->flags = WRITABLE;
             }
@@ -418,6 +433,7 @@ Billiard_connection_recv_payload(BilliardConnectionObject *self)
     char *freeme = NULL;
     Py_ssize_t res;
     PyObject *view = NULL;
+    HANDLE handle;
 
     CHECK_READABLE(self);
 
@@ -426,10 +442,13 @@ Billiard_connection_recv_payload(BilliardConnectionObject *self)
     if (res < 0) {
         if (res == MP_BAD_MESSAGE_LENGTH) {
             if ((self->flags & WRITABLE) == 0) {
-                Py_BEGIN_ALLOW_THREADS
-                CLOSE(self->handle);
-                Py_END_ALLOW_THREADS
-                self->handle = INVALID_HANDLE_VALUE;
+                handle = self->handle;
+                if (handle != INVALID_HANDLE_VALUE) {
+                    self->handle = INVALID_HANDLE_VALUE;
+                    Py_BEGIN_ALLOW_THREADS
+                    CLOSE(handle);
+                    Py_END_ALLOW_THREADS
+                }
             } else {
                 self->flags = WRITABLE;
             }
@@ -456,6 +475,7 @@ Billiard_connection_recv_obj(BilliardConnectionObject *self)
     char *freeme = NULL;
     Py_ssize_t res;
     PyObject *temp = NULL, *result = NULL;
+    HANDLE handle;
 
     CHECK_READABLE(self);
 
@@ -465,10 +485,13 @@ Billiard_connection_recv_obj(BilliardConnectionObject *self)
     if (res < 0) {
         if (res == MP_BAD_MESSAGE_LENGTH) {
             if ((self->flags & WRITABLE) == 0) {
-                Py_BEGIN_ALLOW_THREADS
-                CLOSE(self->handle);
-                Py_END_ALLOW_THREADS
-                self->handle = INVALID_HANDLE_VALUE;
+                handle = self->handle;
+                if (handle != INVALID_HANDLE_VALUE) {
+                    self->handle = INVALID_HANDLE_VALUE;
+                    Py_BEGIN_ALLOW_THREADS
+                    CLOSE(handle);
+                    Py_END_ALLOW_THREADS
+                }
             } else {
                 self->flags = WRITABLE;
             }
@@ -545,11 +568,13 @@ Billiard_connection_fileno(BilliardConnectionObject* self)
 static PyObject *
 Billiard_connection_close(BilliardConnectionObject *self)
 {
-    if (self->handle != INVALID_HANDLE_VALUE) {
+    HANDLE handle = self->handle;
+
+    if (handle != INVALID_HANDLE_VALUE) {
+        self->handle = INVALID_HANDLE_VALUE;
         Py_BEGIN_ALLOW_THREADS
-        CLOSE(self->handle);
+        CLOSE(handle);
         Py_END_ALLOW_THREADS
-        self->handle = INVALID_HANDLE_VALUE;
     }
 
     Py_RETURN_NONE;
diff --git a/PKG-INFO b/PKG-INFO
index 63e0792..a2fae19 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: billiard
-Version: 3.3.0.22
+Version: 3.3.0.23
 Summary: Python multiprocessing fork with improvements and bugfixes
 Home-page: http://github.com/celery/billiard
 Author: Ask Solem
@@ -9,7 +9,7 @@ License: BSD
 Description: ========
         billiard
         ========
-        :version: 3.3.0.22
+        :version: 3.3.0.23
         
         About
         -----
@@ -50,6 +50,16 @@ Description: ========
         Changes
         ===========
         
+        3.3.0.23 - 2016-03-03
+        ---------------------
+        
+        - ExceptionInfo: Adds tb_lasti and other missing traceback fields
+          (Issue #180).
+        
+        - monotonic: Now makes sure ctypes is available.
+        
+        - PipeConnection: Make sure the pipe is not closed multiple times.
+        
         3.3.0.22 - 2015-12-08
         ---------------------
         
diff --git a/README.rst b/README.rst
index 48d5aa1..3a40ccd 100644
--- a/README.rst
+++ b/README.rst
@@ -1,7 +1,7 @@
 ========
 billiard
 ========
-:version: 3.3.0.22
+:version: 3.3.0.23
 
 About
 -----
diff --git a/billiard.egg-info/PKG-INFO b/billiard.egg-info/PKG-INFO
index 63e0792..a2fae19 100644
--- a/billiard.egg-info/PKG-INFO
+++ b/billiard.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: billiard
-Version: 3.3.0.22
+Version: 3.3.0.23
 Summary: Python multiprocessing fork with improvements and bugfixes
 Home-page: http://github.com/celery/billiard
 Author: Ask Solem
@@ -9,7 +9,7 @@ License: BSD
 Description: ========
         billiard
         ========
-        :version: 3.3.0.22
+        :version: 3.3.0.23
         
         About
         -----
@@ -50,6 +50,16 @@ Description: ========
         Changes
         ===========
         
+        3.3.0.23 - 2016-03-03
+        ---------------------
+        
+        - ExceptionInfo: Adds tb_lasti and other missing traceback fields
+          (Issue #180).
+        
+        - monotonic: Now makes sure ctypes is available.
+        
+        - PipeConnection: Make sure the pipe is not closed multiple times.
+        
         3.3.0.22 - 2015-12-08
         ---------------------
         
diff --git a/billiard.egg-info/top_level.txt b/billiard.egg-info/top_level.txt
index dc8a3f0..05ca8b9 100644
--- a/billiard.egg-info/top_level.txt
+++ b/billiard.egg-info/top_level.txt
@@ -1,3 +1,3 @@
-funtests
-billiard
 _billiard
+billiard
+funtests
diff --git a/billiard/__init__.py b/billiard/__init__.py
index af2d8ba..b0fe082 100644
--- a/billiard/__init__.py
+++ b/billiard/__init__.py
@@ -35,7 +35,7 @@ from .exceptions import (  # noqa
 from .process import Process, current_process, active_children
 from .util import SUBDEBUG, SUBWARNING
 
-VERSION = (3, 3, 0, 22)
+VERSION = (3, 3, 0, 23)
 __version__ = '.'.join(map(str, VERSION[0:4])) + "".join(VERSION[4:])
 __author__ = 'R Oudkerk / Python Software Foundation'
 __author_email__ = 'python-dev at python.org'
diff --git a/billiard/einfo.py b/billiard/einfo.py
index e761620..a091c15 100644
--- a/billiard/einfo.py
+++ b/billiard/einfo.py
@@ -3,18 +3,34 @@ from __future__ import absolute_import
 import sys
 import traceback
 
+__all__ = ['ExceptionInfo', 'Traceback']
+
+DEFAULT_MAX_FRAMES = sys.getrecursionlimit() // 8
+
 
 class _Code(object):
 
     def __init__(self, code):
         self.co_filename = code.co_filename
         self.co_name = code.co_name
+        self.co_argcount = code.co_argcount
+        self.co_cellvars = ()
+        self.co_firstlineno = code.co_firstlineno
+        self.co_flags = code.co_flags
+        self.co_freevars = ()
+        self.co_code = b''
+        self.co_lnotab = b''
+        self.co_names = code.co_names
+        self.co_nlocals = code.co_nlocals
+        self.co_stacksize = code.co_stacksize
+        self.co_varnames = ()
 
 
 class _Frame(object):
     Code = _Code
 
     def __init__(self, frame):
+        self.f_builtins = {}
         self.f_globals = {
             "__file__": frame.f_globals.get("__file__", "__main__"),
             "__name__": frame.f_globals.get("__name__"),
@@ -25,8 +41,15 @@ class _Frame(object):
             fl["__traceback_hide__"] = frame.f_locals["__traceback_hide__"]
         except KeyError:
             pass
+        self.f_trace = None
+        self.f_exc_traceback = None
+        self.f_exc_type = None
+        self.f_exc_value = None
         self.f_code = self.Code(frame.f_code)
         self.f_lineno = frame.f_lineno
+        self.f_lasti = frame.f_lasti
+        # don't want to hit https://bugs.python.org/issue21967
+        self.f_restricted = False
 
 
 class _Object(object):
@@ -48,21 +71,20 @@ class _Truncated(object):
                            co_name="[rest of traceback truncated]"),
         )
         self.tb_next = None
+        self.tb_lasti = 0
 
 
 class Traceback(object):
     Frame = _Frame
 
-    tb_frame = tb_lineno = tb_next = None
-    max_frames = sys.getrecursionlimit() // 8
-
-    def __init__(self, tb, max_frames=None, depth=0):
-        limit = self.max_frames = max_frames or self.max_frames
+    def __init__(self, tb, max_frames=DEFAULT_MAX_FRAMES, depth=0):
         self.tb_frame = self.Frame(tb.tb_frame)
         self.tb_lineno = tb.tb_lineno
+        self.tb_lasti = tb.tb_lasti
+        self.tb_next = None
         if tb.tb_next is not None:
-            if depth <= limit:
-                self.tb_next = Traceback(tb.tb_next, limit, depth + 1)
+            if depth <= max_frames:
+                self.tb_next = Traceback(tb.tb_next, max_frames, depth + 1)
             else:
                 self.tb_next = _Truncated()
 
diff --git a/billiard/five.py b/billiard/five.py
index ec0287c..8630e2e 100644
--- a/billiard/five.py
+++ b/billiard/five.py
@@ -36,8 +36,12 @@ if sys.version_info < (3, 3):
     import platform
     SYSTEM = platform.system()
 
-    if SYSTEM == 'Darwin':
+    try:
         import ctypes
+    except ImportError:  # pragma: no cover
+        ctypes = None  # noqa
+
+    if SYSTEM == 'Darwin' and ctypes is not None:
         from ctypes.util import find_library
         libSystem = ctypes.CDLL(find_library('libSystem.dylib'))
         CoreServices = ctypes.CDLL(find_library('CoreServices'),
@@ -51,7 +55,7 @@ if sys.version_info < (3, 3):
         def _monotonic():
             return absolute_to_nanoseconds(mach_absolute_time()) * 1e-9
 
-    elif SYSTEM == 'Linux':
+    elif SYSTEM == 'Linux' and ctypes is not None:
         # from stackoverflow:
         # questions/1205722/how-do-i-get-monotonic-time-durations-in-python
         import ctypes
diff --git a/billiard/forking.py b/billiard/forking.py
index 57fc979..d67ef8a 100644
--- a/billiard/forking.py
+++ b/billiard/forking.py
@@ -129,7 +129,7 @@ if sys.platform != 'win32':
             # `w` will be closed when the child exits, at which point `r`
             # will become ready for reading (using e.g. select()).
             os.close(w)
-            util.Finalize(self, os.close, (r,))
+            util.Finalize(self, os.close, (self.sentinel,))
 
         def poll(self, flag=os.WNOHANG):
             if self.returncode is None:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/billiard.git



More information about the Python-modules-commits mailing list