Fixed a failure on Python 3 introduced by 5939864616d56cf949f0bca348a8e05230b62fe0.

Refs #15653.