What error are you expecting here? Note that ``except`` should always specify the type(s) of ``Exceptions`` - it's very prone to strange failures (in case some unexpected ``Exception`` is raised). It seems to me like this ``try/except`` might not be needed, and that you could just do your ``if/else``, calling ``pass`` in the ``else`` block, and then returning the result.