cut-backtrace.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132
  1. commit 2f67b87b07c235c9673305da4d5530e220bc740e
  2. merge: 2e2af14ef0720fef44002ed5f6941f229bdd7440 a53ffec0a5bd88ef05a9a011375afa2ccaa8cd8c
  3. author: orivej
  4. date: 2019-07-06T08:14:28+03:00
  5. revision: 5216645
  6. Cut importlib._bootstrap and __res.ResourceImporter.exec_module from py3 backtraces. DEVTOOLS-5630
  7. This is controlled by _call_with_frames_removed in __res.ResourceImporter.exec_module.
  8. REVIEW: 869507
  9. --- contrib/tools/python3/Python/import.c (2e2af14ef0720fef44002ed5f6941f229bdd7440)
  10. +++ contrib/tools/python3/Python/import.c (2f67b87b07c235c9673305da4d5530e220bc740e)
  11. @@ -1478,6 +1478,7 @@ remove_importlib_frames(PyThreadState *tstate)
  12. {
  13. const char *importlib_filename = "<frozen importlib._bootstrap>";
  14. const char *external_filename = "<frozen importlib._bootstrap_external>";
  15. + const char *importer_filename = "library/python/runtime_py3/importer.pxi";
  16. const char *remove_frames = "_call_with_frames_removed";
  17. int always_trim = 0;
  18. int in_importlib = 0;
  19. @@ -1508,7 +1509,8 @@ remove_importlib_frames(PyThreadState *tstate)
  20. int now_in_importlib;
  21. now_in_importlib = _PyUnicode_EqualToASCIIString(code->co_filename, importlib_filename) ||
  22. - _PyUnicode_EqualToASCIIString(code->co_filename, external_filename);
  23. + _PyUnicode_EqualToASCIIString(code->co_filename, external_filename) ||
  24. + _PyUnicode_EqualToASCIIString(code->co_filename, importer_filename);
  25. if (now_in_importlib && !in_importlib) {
  26. /* This is the link to this chunk of importlib tracebacks */
  27. outer_link = prev_link;