backtest.py 660 B

1234567891011121314151617181920
  1. # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
  2. # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
  3. """Add things to old Pythons so I can pretend they are newer, for tests."""
  4. # pylint: disable=redefined-builtin
  5. # (Redefining built-in blah)
  6. # The whole point of this file is to redefine built-ins, so shut up about it.
  7. # No more execfile in Py3
  8. try:
  9. execfile = execfile
  10. except NameError:
  11. def execfile(filename, globs):
  12. """A Python 3 implementation of execfile."""
  13. with open(filename) as fobj:
  14. code = fobj.read()
  15. exec(compile(code, filename, 'exec'), globs)