Remove useless assert.

Python will raise an exception anyway if any of these variables is None.
Raise an exception rather than assert.

We want to catch that case even if Python is invoked with -O.