Fixed a deprecation warning on Python 3.