A small bit of python3 friendliness to setup.py

The file() builtin no longer exists in python3. Use open() instead.
Also explicitly using the locals() dict to avoid a NameError.