3

Possible Duplicate:
How can you limit the allowed execution time of specific methods in the python version of Google App Engine?

When I run the following code in Eclipse, nothing happens, as expected:

import signal

def signal_handler(signum, frame):
    raise Exception, "Timed out!"
signal.signal(signal.SIGALRM, signal_handler)

However, when I try to run it using GAE, I get the error:

signal.signal(signal.SIGALRM, signal_handler)
AttributeError: 'module' object has no attribute 'signal'

My guess is that GAE is running a different installment of Python than Eclipse, that may have certain modules removed/blocked because google has that power.

I got the code from: How to limit execution time of a function call in Python

Help? Thanks

Community
  • 1
  • 1
Alex Varga
  • 1,752
  • 2
  • 14
  • 17
  • `signal` is not on the list of [python customized modules](https://developers.google.com/appengine/docs/python/runtime#Pure_Python). It *could* be there is another module named `signal` in your project that is being imported instead of the stdlib `signal` module. Test the `signal.__file__` attribute to test. – Martijn Pieters Sep 22 '12 at 06:50
  • Martijn Pieters: I had that thought, but I looked into it and python will not let a signal.py file supercede the builtin signal module. – Mu Mind Sep 22 '12 at 06:52

0 Answers0