ionelmc / python-hunter

Hunter is a flexible code tracing toolkit.
https://python-hunter.readthedocs.io/
BSD 2-Clause "Simplified" License
796 stars 46 forks source link

Always pass module_globals dict to linecache methods to support PEP-302 loaders #65

Closed borman closed 5 years ago

borman commented 5 years ago

Without module_globals, getline()/getlines() only try to load source from filesystem. In order to find source for non-filesystem modules, module_globals should be passed, which allows linecache to query module loader (found via __loader__ global name in module).

ionelmc commented 5 years ago

Hmm good catch. Please add yourself to AUTHORS and maybe CHANGELOG.rst.

codecov-io commented 5 years ago

Codecov Report

Merging #65 into master will not change coverage. The diff coverage is 88.88%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #65   +/-   ##
=======================================
  Coverage   75.77%   75.77%           
=======================================
  Files          13       13           
  Lines        2039     2039           
  Branches      198      198           
=======================================
  Hits         1545     1545           
  Misses        445      445           
  Partials       49       49
Impacted Files Coverage Δ
src/hunter/_event.pyx 67.62% <100%> (ø) :arrow_up:
src/hunter/event.py 63.07% <75%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c86be40...b6bda79. Read the comment docs.

borman commented 5 years ago

Please add yourself to AUTHORS and maybe CHANGELOG.rst.

Updated.

ionelmc commented 5 years ago

Included in master as 4510d1a and e8e18ad. Thanks!