ponyorm / pony

Pony Object Relational Mapper
Apache License 2.0
3.65k stars 244 forks source link

Compiled query code uses the source as the filename, confusing tools #593

Open nedbat opened 3 years ago

nedbat commented 3 years ago

Coverage.py has an issue about phantom code when using PonyORM: https://github.com/nedbat/coveragepy/issues/1136

The problem arises because of this line:

code = compile(src, src, 'eval')

This compiles src, but uses src as the filename also. This causes coverage.py to think there is a file with that name.

A common convention for synthetic filenames is to use angle brackets, and to indicate something about the origin. I can make a pull request to update this line if that's OK.

nedbat commented 3 years ago

594 is a simple fix.