This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bukzor
Recipients bukzor, terry.reedy
Date 2010-09-20.22:59:16
SpamBayes Score 0.013835
Marked as misclassified No
Message-id <1285023561.54.0.872846818201.issue9583@psf.upfronthosting.co.za>
In-reply-to
Content
Minimal demo:

$ setenv PYTHONOPTIMIZE 0
$ python3.1 -OO -c "print(__debug__)"
False


I've used this code to get the desired functionality:

if [[ $TESTING == 1 || ${PYTHONOPTIMIZE-2} =~ '^(0*|)$' ]]; then
    #someone is requesting no optimization
    export -n PYTHONOPTIMIZE
    opt=''
elif [[ $PYTHONOPTIMIZE ]]; then
    #someone is setting their own optimization
    opt=''
else
    #optimization by default
    opt='-O'
fi

exec $INSTALL_BASE/bin/python2.6 $opt "$@"
History
Date User Action Args
2010-09-20 22:59:21bukzorsetrecipients: + bukzor, terry.reedy
2010-09-20 22:59:21bukzorsetmessageid: <1285023561.54.0.872846818201.issue9583@psf.upfronthosting.co.za>
2010-09-20 22:59:20bukzorlinkissue9583 messages
2010-09-20 22:59:16bukzorcreate