there should be an extra check:

    if val is None: return val

Also make sure that all tests pass :) To do that launch the following commands on the root of the gunicorn sources:

    $ pip install -r requirements_dev.txt
    $ py.test