In the script action: Get around a Python bug.

This is a fix for issue #4256.