Ideally this would be:

```python
with open(r, 'r') as f:
    exec(f.read(), scratch_locals)
```