Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31058

an error in python lib?

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <whzhao@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.020
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'else:': 0.03; 'here?': 0.09; 'def': 0.10; 'subject:error': 0.11; 'subject:python': 0.11; 'thanks,': 0.18; 'skip:_ 20': 0.22; 'values': 0.26; 'message- id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'noticed': 0.28; 'skip:_ 10': 0.29; 'class': 0.29; 'received:209.85.160.46': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'wrong': 0.34; 'false': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'method': 0.36; 'should': 0.36; 'received:209': 0.37; 'to:addr:python.org': 0.39; 'called': 0.39; 'list,': 0.39; 'header:Received:5': 0.40; 'skip:/ 30': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=k7XUaf8rIxE4zsrxDVV73jBgwjZLdE9SExDWkiZSc90=; b=gUt5kKiNUr/KdVf6vpaGjpF5+0SsXjUY7R8Z4KbyczvPLI+Xr0ltK+Fbh9yN1dpTlM yc7ORjqOufX11H+k6Ouyqrv2nZ9CtDkJQ0GpbRNiSl46rxp6u3TbUV6xxX4dr7TGk965 jqogZhu6+UYg/JKWoKc+MIqm1CFr9naVQozORCSq64JwZ8+G/jP0jPMF7CR2C2S9WOkQ Tfc1Zz2HVmz3r/4JOyy53wP2iWQJ/T5QH9gtKmAKSmNPX+VpUb2APMdqy77xLGzXbM32 5epw/iMaMdrOrKolYM0ghgVx51XYN3FbAW3c18qjkC6DMHc8uzYcQnGDm5je379H8k38 A4cg==
MIME-Version 1.0
Date Tue, 9 Oct 2012 17:32:11 -0700
Subject an error in python lib?
From Wenhua Zhao <whzhao@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2017.1349829133.27098.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1349829133 news.xs4all.nl 6918 [2001:888:2000:d::a6]:39648
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:31058

Show key headers only | View raw


Hi list,

I just noticed that in /usr/lib/python2.7/threading.py

class _Condition(_Verbose):
    ...
    def _is_owned(self):
        # Return True if lock is owned by current_thread.
        # This method is called only if __lock doesn't have
_is_owned().
        if self.__lock.acquire(0):
            self.__lock.release()
            return False
        else:
            return True

The return values seem to be wrong.  They should be swapped:

    def _is_owned(self):
        if self.__lock.acquire(0):
            self.__lock.release()
            return True
        else:
            return False

Or I understood it wrong here?

Thanks,
Wenhua

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

an error in python lib? Wenhua Zhao <whzhao@gmail.com> - 2012-10-09 17:32 -0700
  Re: an error in python lib? Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-10-10 14:04 +0200

csiph-web