fix to work with older versions of python3, fixes #1