All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Yang <liezhi.yang@windriver.com>
To: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: python's assert doesn't work
Date: Thu, 25 Apr 2013 21:09:41 +0800	[thread overview]
Message-ID: <51792B15.4010001@windriver.com> (raw)


Both native and target python's assert doesn't work, because python
has been optimized by default by us:

--- Python-2.6.1.orig/Python/compile.c
+++ Python-2.6.1/Python/compile.c
@@ -32,7 +32,7 @@
  #include "symtable.h"
  #include "opcode.h"

-int Py_OptimizeFlag = 0;
+int Py_OptimizeFlag = 1;

  #define DEFAULT_BLOCK_SIZE 16
  #define DEFAULT_BLOCKS 8

The optimization should be specified by the user, for example,  run by
"python -O/OO", or "export PYTHONOPTIMIZE" in the env, but we have hardcode
it, then we can't change it back to 0, and this causes the "assert" doesn't
work, e.g.: the "assert False" should raise error, but it doesn't, this may
hide or cause unexpected errors.

I'd like to send a patch to change it back if you are fine with it,
and we can set PYTHONOPTIMIZE in the env if we really need it, this
gives the user a way to disable the optimization.

-- 
Thanks

Robert



                 reply	other threads:[~2013-04-25 13:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51792B15.4010001@windriver.com \
    --to=liezhi.yang@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.