FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Don't require `_testcapi` for `test_code` by ShaharNaveh · Pull Request #152185 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
3 changes: 2 additions & 1 deletion Lib/test/test_code.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@
from test.support import threading_helper, import_helper
from test.support.bytecode_helper import instructions_with_positions
from opcode import opmap, opname
from _testcapi import code_offset_to_line
try:
import _testinternalcapi
except ModuleNotFoundError:
Expand Down Expand Up @@ -1491,6 +1490,8 @@ async def async_func():
rc, out, err = assert_python_ok('-OO', '-c', code)

def test_co_branches(self):
_testcapi = import_helper.import_module("_testcapi")
code_offset_to_line = _testcapi.code_offset_to_line

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I can make it to a single line if that's preferred, I think it looks better this way but I don't feel strongly about it


def get_line_branches(func):
code = func.__code__
Expand Down
Loading

Back | FazBrowse Home | New Git URL