Without this change, the `file` parameter in print() causes problems in Python 2. This approach makes print(x, file=filename) valid syntax in both Python 2 and Python 3.