building release - assert-free python library

Discussion in 'Python' started by grbgooglefan, Apr 7, 2009.

  1. grbgooglefan

    grbgooglefan Guest

    How can I build a release and not the debug version of libpython.a?
    I have seen that there are assert, abort statements in lot many
    functions in Python code. I would like to avoid those when compiling
    the libpython.a library because when this libpython gets used for
    production purpose and it aborts, the application goes down without
    any means of graceful handling that error condition.
    How can we handle this?
    Please help
     
    grbgooglefan, Apr 7, 2009
    #1
    1. Advertising

  2. grbgooglefan wrote:
    > How can I build a release and not the debug version of libpython.a?
    > I have seen that there are assert, abort statements in lot many
    > functions in Python code. I would like to avoid those when compiling
    > the libpython.a library because when this libpython gets used for
    > production purpose and it aborts, the application goes down without
    > any means of graceful handling that error condition.


    You are misunderstanding assertions. If an assertion fires, you always have
    a programming error that can not be recovered from. So, your program will
    go down anyway, the difference is a defined way from an assertion compared
    to an undefined one that can mean random corruption sometime sooner or
    later. That said, the only reason to go without assertions is to improve
    performance.

    Uli

    --
    Sator Laser GmbH
    Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
     
    Ulrich Eckhardt, Apr 7, 2009
    #2
    1. Advertising

  3. grbgooglefan

    Aahz Guest

    In article <>,
    grbgooglefan <> wrote:
    >
    >How can I build a release and not the debug version of libpython.a?
    >I have seen that there are assert, abort statements in lot many
    >functions in Python code. I would like to avoid those when compiling
    >the libpython.a library because when this libpython gets used for
    >production purpose and it aborts, the application goes down without
    >any means of graceful handling that error condition.
    >How can we handle this?


    Are you talking about Python source code or C source code?
    --
    Aahz () <*> http://www.pythoncraft.com/

    Why is this newsgroup different from all other newsgroups?
     
    Aahz, Apr 10, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Brewer
    Replies:
    1
    Views:
    491
    bsmith
    Nov 7, 2004
  2. Thomas Guettler

    assert 0, "foo" vs. assert(0, "foo")

    Thomas Guettler, Feb 23, 2005, in forum: Python
    Replies:
    3
    Views:
    2,526
    Carl Banks
    Feb 23, 2005
  3. Alex Vinokur

    assert(x) and '#define ASSERT(x) assert(x)'

    Alex Vinokur, Nov 25, 2004, in forum: C Programming
    Replies:
    5
    Views:
    918
    Keith Thompson
    Nov 25, 2004
  4. ImpalerCore

    To assert or not to assert...

    ImpalerCore, Apr 27, 2010, in forum: C Programming
    Replies:
    79
    Views:
    1,671
    Richard Bos
    May 17, 2010
  5. Alex Chaffee
    Replies:
    6
    Views:
    128
    Phlip
    Sep 7, 2010
Loading...

Share This Page