| 249 | | while self.state != state: |
|---|
| 250 | | time.sleep(interval) |
|---|
| | 249 | def _wait(): |
|---|
| | 250 | while self.state != state: |
|---|
| | 251 | time.sleep(interval) |
|---|
| | 252 | |
|---|
| | 253 | # From http://psyco.sourceforge.net/psycoguide/bugs.html: |
|---|
| | 254 | # "The compiled machine code does not include the regular polling |
|---|
| | 255 | # done by Python, meaning that a KeyboardInterrupt will not be |
|---|
| | 256 | # detected before execution comes back to the regular Python |
|---|
| | 257 | # interpreter. Your program cannot be interrupted if caught |
|---|
| | 258 | # into an infinite Psyco-compiled loop." |
|---|
| | 259 | try: |
|---|
| | 260 | sys.modules['psyco'].cannotcompile(_wait) |
|---|
| | 261 | except (KeyError, AttributeError): |
|---|
| | 262 | pass |
|---|
| | 263 | |
|---|
| | 264 | _wait() |
|---|