Checking for header Python.h

I don’t understand why do I get a :frowning: when build.py script is checking for Python.h header file before it compiles Phoenix.

Checking for header Python.h : :frowning:

Phoenix compiles successfuly though, but I don’t understant why do I get that sad face. Anyone knows?

Bo�tjan Mejak wrote:

I don't understand why do I get a :frowning: when build.py script is checking
for Python.h header file before it compiles Phoenix.

Checking for header Python.h : :frowning:

Phoenix compiles successfuly though, but I don't understant why do I get
that sad face. Anyone knows?

It looks like there is a failure inside a try/except, so presumably something in the except clause is working around the issue and allowing the build to continue.

···

--
Robin Dunn
Software Craftsman

But the build should not continue then… Can you take a look at the try/except? I looked at the source but could not find any obvious mistakes.

···

On Mon, Apr 8, 2013 at 10:07 PM, Robin Dunn robin@alldunn.com wrote:

Boštjan Mejak wrote:

I don’t understand why do I get a :frowning: when build.py script is checking

for Python.h header file before it compiles Phoenix.

Checking for header Python.h : :frowning:

Phoenix compiles successfuly though, but I don’t understant why do I get

that sad face. Anyone knows?

It looks like there is a failure inside a try/except, so presumably something in the except clause is working around the issue and allowing the build to continue.

Robin Dunn

Software Craftsman

http://wxPython.org

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Boštjan Mejak wrote:

But the build should not continue then...

Why? That is the main purpose of the except clause in a try/except statement, to gracefully recover from a problem. If it's also able to work around the problem and allow the program to continue then that's even better.

Consider this:

  try:
    foo()
  except:
    bar()

It is expected and acceptable that foo can fail, that is why the programmer used the try/except, and just because it may fail does not mean that something is wrong or broken. It just means that some other bit of code should be executed instead. If foo returned an error code instead of raising an exception then something like the following would be equivalent to the code above:

  if foo() != success_code:
    bar()

and I'm sure you will agree that using if statements is not an uncommon thing to do.

···

--
Robin Dunn
Software Craftsman

Robin, do you get that sad face as well when you compile Phoenix from source? Also, can you link me to the source code that has this try/except clause?

···

On Tue, Apr 9, 2013 at 11:06 PM, Robin Dunn robin@alldunn.com wrote:

Boštjan Mejak wrote:

But the build should not continue then…

Why? That is the main purpose of the except clause in a try/except statement, to gracefully recover from a problem. If it’s also able to work around the problem and allow the program to continue then that’s even better.

Consider this:

    try:

            foo()

    except:

            bar()

It is expected and acceptable that foo can fail, that is why the programmer used the try/except, and just because it may fail does not mean that something is wrong or broken. It just means that some other bit of code should be executed instead. If foo returned an error code instead of raising an exception then something like the following would be equivalent to the code above:

    if foo() != success_code:

            bar()

and I’m sure you will agree that using if statements is not an uncommon thing to do.

Robin Dunn

Software Craftsman

http://wxPython.org

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Boštjan Mejak wrote:

Robin, do you get that sad face as well when you compile Phoenix from
source?

Not recently, but I think I've seen it before.

Also, can you link me to the source code that has this
try/except clause?

It's in the same file that you edited when you made the patch for waf before, in waflib/Tools/python.py. Just search for ":-("

···

--
Robin Dunn
Software Craftsman