Fix flake8 warnings in framework.py

To test this PR check Travis is green.