Like in #248, there has to be a way to do this without a try-except block, which should only be used in exceptional cases.