Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-yappi for openSUSE:Factory 
checked in at 2022-11-14 14:28:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-yappi (Old)
 and      /work/SRC/openSUSE:Factory/.python-yappi.new.1597 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-yappi"

Mon Nov 14 14:28:58 2022 rev:14 rq:1035576 version:1.4.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-yappi/python-yappi.changes        
2022-09-19 16:04:19.614309065 +0200
+++ /work/SRC/openSUSE:Factory/.python-yappi.new.1597/python-yappi.changes      
2022-11-14 14:29:08.003011262 +0100
@@ -1,0 +2,6 @@
+Wed Nov  9 19:54:11 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com>
+
+- Update to 1.4.0 
+  * Add support for Python 3.11
+
+-------------------------------------------------------------------

Old:
----
  yappi-1.3.6.tar.gz

New:
----
  yappi-1.4.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-yappi.spec ++++++
--- /var/tmp/diff_new_pack.hCTqlR/_old  2022-11-14 14:29:10.131021113 +0100
+++ /var/tmp/diff_new_pack.hCTqlR/_new  2022-11-14 14:29:10.139021150 +0100
@@ -20,7 +20,7 @@
 %define skip_python2 1
 %define skip_python36 1
 Name:           python-yappi
-Version:        1.3.6
+Version:        1.4.0
 Release:        0
 Summary:        Yet Another Python Profiler
 License:        MIT

++++++ yappi-1.3.6.tar.gz -> yappi-1.4.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yappi-1.3.6/PKG-INFO new/yappi-1.4.0/PKG-INFO
--- old/yappi-1.3.6/PKG-INFO    2022-08-03 10:01:12.526561700 +0200
+++ new/yappi-1.4.0/PKG-INFO    2022-10-31 09:14:26.127572000 +0100
@@ -1,12 +1,12 @@
 Metadata-Version: 2.1
 Name: yappi
-Version: 1.3.6
+Version: 1.4.0
 Summary: Yet Another Python Profiler
 Home-page: https://github.com/sumerc/yappi
-Author: Sumer Cip
+Author: Sümer Cip
 Author-email: sum...@gmail.com
 License: MIT
-Keywords: python thread multithread profiler
+Keywords: python thread multithread asyncio gevent profiler
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Console
 Classifier: Intended Audience :: Developers
@@ -33,13 +33,14 @@
 
 <h1 align="center">Yappi</h1>
 <p align="center">
-    A tracing profiler that is <b>thread&coroutine&greenlet</b> aware.
+    A tracing profiler that is <b>multithreading, asyncio and gevent</b> aware.
 </p>
 
 <p align="center">
     <img src="https://www.travis-ci.org/sumerc/yappi.svg?branch=master";>
     <img 
src="https://github.com/sumerc/yappi/workflows/CI/badge.svg?branch=master";>
     <img src="https://img.shields.io/pypi/v/yappi.svg";>
+    <img src="https://img.shields.io/pypi/dw/yappi.svg";>
     <img src="https://img.shields.io/pypi/pyversions/yappi.svg";>
     <img src="https://img.shields.io/github/last-commit/sumerc/yappi.svg";>
     <img src="https://img.shields.io/github/license/sumerc/yappi.svg";>
@@ -47,12 +48,12 @@
 
 ## Highlights
 
-- **Fast**: Yappi is fast. It is completely written in C and lots of love&care 
went into making it fast.
+- **Fast**: Yappi is fast. It is completely written in C and lots of love and 
care went into making it fast.
 - **Unique**: Yappi supports multithreaded, 
[asyncio](https://github.com/sumerc/yappi/blob/master/doc/coroutine-profiling.md)
 and 
[gevent](https://github.com/sumerc/yappi/blob/master/doc/greenlet-profiling.md) 
profiling. Tagging/filtering multiple profiler results has interesting [use 
cases](https://github.com/sumerc/yappi/blob/master/doc/api.md#set_tag_callback).
 - **Intuitive**: Profiler can be started/stopped and results can be obtained 
from any time and any thread.
 - **Standards Compliant**: Profiler results can be saved in 
[callgrind](http://valgrind.org/docs/manual/cl-format.html) or 
[pstat](http://docs.python.org/3.4/library/profile.html#pstats.Stats) formats.
 - **Rich in Feature set**: Profiler results can show either [Wall 
Time](https://en.wikipedia.org/wiki/Elapsed_real_time) or actual [CPU 
Time](http://en.wikipedia.org/wiki/CPU_time) and can be aggregated from 
different sessions. Various flags are defined for filtering and sorting 
profiler results.
-- **Robust**: Yappi had seen years of production usage.
+- **Robust**: Yappi has been around for years.
 
 ## Motivation
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yappi-1.3.6/README.md new/yappi-1.4.0/README.md
--- old/yappi-1.3.6/README.md   2022-08-03 10:00:50.000000000 +0200
+++ new/yappi-1.4.0/README.md   2022-10-31 09:14:14.000000000 +0100
@@ -4,13 +4,14 @@
 
 <h1 align="center">Yappi</h1>
 <p align="center">
-    A tracing profiler that is <b>thread&coroutine&greenlet</b> aware.
+    A tracing profiler that is <b>multithreading, asyncio and gevent</b> aware.
 </p>
 
 <p align="center">
     <img src="https://www.travis-ci.org/sumerc/yappi.svg?branch=master";>
     <img 
src="https://github.com/sumerc/yappi/workflows/CI/badge.svg?branch=master";>
     <img src="https://img.shields.io/pypi/v/yappi.svg";>
+    <img src="https://img.shields.io/pypi/dw/yappi.svg";>
     <img src="https://img.shields.io/pypi/pyversions/yappi.svg";>
     <img src="https://img.shields.io/github/last-commit/sumerc/yappi.svg";>
     <img src="https://img.shields.io/github/license/sumerc/yappi.svg";>
@@ -18,12 +19,12 @@
 
 ## Highlights
 
-- **Fast**: Yappi is fast. It is completely written in C and lots of love&care 
went into making it fast.
+- **Fast**: Yappi is fast. It is completely written in C and lots of love and 
care went into making it fast.
 - **Unique**: Yappi supports multithreaded, 
[asyncio](https://github.com/sumerc/yappi/blob/master/doc/coroutine-profiling.md)
 and 
[gevent](https://github.com/sumerc/yappi/blob/master/doc/greenlet-profiling.md) 
profiling. Tagging/filtering multiple profiler results has interesting [use 
cases](https://github.com/sumerc/yappi/blob/master/doc/api.md#set_tag_callback).
 - **Intuitive**: Profiler can be started/stopped and results can be obtained 
from any time and any thread.
 - **Standards Compliant**: Profiler results can be saved in 
[callgrind](http://valgrind.org/docs/manual/cl-format.html) or 
[pstat](http://docs.python.org/3.4/library/profile.html#pstats.Stats) formats.
 - **Rich in Feature set**: Profiler results can show either [Wall 
Time](https://en.wikipedia.org/wiki/Elapsed_real_time) or actual [CPU 
Time](http://en.wikipedia.org/wiki/CPU_time) and can be aggregated from 
different sessions. Various flags are defined for filtering and sorting 
profiler results.
-- **Robust**: Yappi had seen years of production usage.
+- **Robust**: Yappi has been around for years.
 
 ## Motivation
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yappi-1.3.6/run_tests.py new/yappi-1.4.0/run_tests.py
--- old/yappi-1.3.6/run_tests.py        2022-08-03 10:00:51.000000000 +0200
+++ new/yappi-1.4.0/run_tests.py        2022-10-31 09:14:14.000000000 +0100
@@ -19,9 +19,9 @@
         'test_functionality',
         'test_hooks',
         'test_tags',
+        'test_gevent',
     ]
-    if sys.version_info < (3, 10):
-        tests += ['test_gevent']
+    # TODO: make these auto-skip if cannot be imported
     if sys.version_info >= (3, 4):
         tests += ['test_asyncio']
     if sys.version_info >= (3, 7):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yappi-1.3.6/setup.py new/yappi-1.4.0/setup.py
--- old/yappi-1.3.6/setup.py    2022-08-03 10:00:51.000000000 +0200
+++ new/yappi-1.4.0/setup.py    2022-10-31 09:14:14.000000000 +0100
@@ -12,7 +12,7 @@
 
 HOMEPAGE = "https://github.com/sumerc/yappi";
 NAME = "yappi"
-VERSION = "1.3.6"
+VERSION = "1.4.0"
 _DEBUG = False  # compile/link code for debugging
 _PROFILE = False  # profile yappi itself
 
@@ -62,10 +62,12 @@
     'Topic :: Software Development :: Libraries :: Python Modules',
 ]
 
+test_deps = ['gevent>=20.6.2']
+
 setup(
     name=NAME,
     version=VERSION,
-    author="Sumer Cip",
+    author="Sümer Cip",
     author_email="sum...@gmail.com",
     ext_modules=[
         Extension(
@@ -91,11 +93,11 @@
     description="Yet Another Python Profiler",
     long_description=long_description,
     long_description_content_type='text/markdown',
-    keywords="python thread multithread profiler",
+    keywords="python thread multithread asyncio gevent profiler",
     classifiers=CLASSIFIERS,
     license="MIT",
     url=HOMEPAGE,
     extras_require={
-        'test': ['gevent>=20.6.2'],
+        'test': test_deps,
     }
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yappi-1.3.6/tests/test_asyncio.py 
new/yappi-1.4.0/tests/test_asyncio.py
--- old/yappi-1.3.6/tests/test_asyncio.py       2022-08-03 10:00:51.000000000 
+0200
+++ new/yappi-1.4.0/tests/test_asyncio.py       2022-10-31 09:14:14.000000000 
+0100
@@ -5,20 +5,18 @@
 from utils import YappiUnitTestCase, find_stat_by_name, burn_cpu, burn_io
 
 
-@asyncio.coroutine
-def async_sleep(sec):
-    yield from asyncio.sleep(sec)
+async def async_sleep(sec):
+    await asyncio.sleep(sec)
 
 
 class SingleThreadTests(YappiUnitTestCase):
 
     def test_issue58(self):
 
-        @asyncio.coroutine
-        def mt(d):
+        async def mt(d):
             t = asyncio.Task(async_sleep(3 + d))
-            yield from async_sleep(3)
-            yield from t
+            await async_sleep(3)
+            await t
 
         yappi.set_clock_type('wall')
 
@@ -41,14 +39,13 @@
 
     def test_recursive_coroutine(self):
 
-        @asyncio.coroutine
-        def a(n):
+        async def a(n):
             if n <= 0:
                 return
-            yield from async_sleep(0.1)
+            await async_sleep(0.1)
             burn_cpu(0.1)
-            yield from a(n - 1)
-            yield from a(n - 2)
+            await a(n - 1)
+            await a(n - 2)
 
         yappi.set_clock_type("cpu")
         yappi.start()
@@ -65,13 +62,12 @@
 
     def test_basic_old_style(self):
 
-        @asyncio.coroutine
-        def a():
-            yield from async_sleep(0.1)
+        async def a():
+            await async_sleep(0.1)
             burn_io(0.1)
-            yield from async_sleep(0.1)
+            await async_sleep(0.1)
             burn_io(0.1)
-            yield from async_sleep(0.1)
+            await async_sleep(0.1)
             burn_cpu(0.3)
 
         yappi.set_clock_type("wall")
@@ -111,22 +107,19 @@
 
     def test_basic(self):
 
-        @asyncio.coroutine
-        def a():
-            yield from async_sleep(0.3)
+        async def a():
+            await async_sleep(0.3)
             burn_cpu(0.4)
 
-        @asyncio.coroutine
-        def b():
-            yield from a()
+        async def b():
+            await a()
 
-        @asyncio.coroutine
-        def recursive_a(n):
+        async def recursive_a(n):
             if not n:
                 return
             burn_io(0.3)
-            yield from async_sleep(0.3)
-            yield from recursive_a(n - 1)
+            await async_sleep(0.3)
+            await recursive_a(n - 1)
 
         tlocal = threading.local()
 
@@ -158,12 +151,10 @@
             ts.append(t)
             _ctag += 1
 
-        @asyncio.coroutine
-        def stop_loop():
+        async def stop_loop():
             asyncio.get_event_loop().stop()
 
-        @asyncio.coroutine
-        def driver():
+        async def driver():
             futs = []
             fut = asyncio.run_coroutine_threadsafe(a(), ts[0]._loop)
             futs.append(fut)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yappi-1.3.6/tests/test_gevent.py 
new/yappi-1.4.0/tests/test_gevent.py
--- old/yappi-1.3.6/tests/test_gevent.py        2022-08-03 10:00:51.000000000 
+0200
+++ new/yappi-1.4.0/tests/test_gevent.py        2022-10-31 09:14:14.000000000 
+0100
@@ -1,15 +1,21 @@
 import unittest
 import _yappi
 import yappi
-import gevent
-from gevent.event import Event
 import threading
 from utils import (
-    YappiUnitTestCase, find_stat_by_name, burn_cpu, burn_io,
-    burn_io_gevent
+    YappiUnitTestCase, find_stat_by_name, burn_cpu, burn_io, burn_io_gevent
 )
 
+GEVENT_AVAIL = True
+try:
+    import gevent
+    from gevent.event import Event
+except ImportError:
+    GEVENT_AVAIL = False
+
+
 class GeventTestThread(threading.Thread):
+
     def __init__(self, name, *args, **kwargs):
         super(GeventTestThread, self).__init__(*args, **kwargs)
         self.name = name
@@ -19,6 +25,10 @@
         gevent.get_hub().name = "Hub"
         super(GeventTestThread, self).run()
 
+
+@unittest.skipIf(
+    not GEVENT_AVAIL, "Gevent is not installed on the target system"
+)
 class GeventTest(YappiUnitTestCase):
 
     def setUp(self):
@@ -51,6 +61,7 @@
         t.start()
         return t
 
+
 class TestAPI(GeventTest):
 
     def test_start_flags(self):
@@ -68,7 +79,9 @@
         yappi.stop()
         yappi.clear_stats()
 
-        yappi.start(builtins=True, profile_greenlets=True, 
profile_threads=False)
+        yappi.start(
+            builtins=True, profile_greenlets=True, profile_threads=False
+        )
         self.assertEqual(_yappi._get_start_flags()["profile_builtins"], 1)
         self.assertEqual(_yappi._get_start_flags()["profile_multicontext"], 1)
         self.assertEqual(len(yappi.get_greenlet_stats()), 1)
@@ -76,16 +89,21 @@
 
     def test_context_change_exception(self):
         yappi.start()
+
         def a():
             pass
 
         a()
         # Setting to same backend should succeed
         # Changing backend should fail
-        self.assertRaises(_yappi.error, yappi.set_context_backend, 
"native_thread")
+        self.assertRaises(
+            _yappi.error, yappi.set_context_backend, "native_thread"
+        )
         yappi.stop()
         # Still fail, stats need to be cleared
-        self.assertRaises(_yappi.error, yappi.set_context_backend, 
"native_thread")
+        self.assertRaises(
+            _yappi.error, yappi.set_context_backend, "native_thread"
+        )
         yappi.clear_stats()
         # Should succeed now
         yappi.set_context_backend("native_thread")
@@ -93,6 +111,7 @@
 
     def test_get_context_stat_exception(self):
         yappi.start()
+
         def a():
             pass
 
@@ -106,6 +125,7 @@
         yappi.set_context_backend("native_thread")
 
         class ThreadA(threading.Thread):
+
             def run(self):
                 burn_cpu(0.05)
 
@@ -127,7 +147,9 @@
 
         tstats = yappi.get_thread_stats()
 
-        self.assertEqual(len(tstats), 2, "Incorrect number of contexts 
captured")
+        self.assertEqual(
+            len(tstats), 2, "Incorrect number of contexts captured"
+        )
 
         # First stat should be of threadA since it is sorted by ttot
         statsA = tstats[0]
@@ -139,6 +161,7 @@
         self.assertEqual(statsMain.tid, main_thread.ident)
         self.assertEqual(statsMain.name, main_thread.__class__.__name__)
 
+
 class SingleThreadTests(GeventTest):
 
     def test_recursive_greenlet(self):
@@ -148,14 +171,14 @@
                 return
             burn_io_gevent(0.1)
             burn_cpu(0.1)
-            g1 = self.spawn_greenlet("a_%d" % (n-1), a, n - 1)
+            g1 = self.spawn_greenlet("a_%d" % (n - 1), a, n - 1)
             g1.get()
-            g2 = self.spawn_greenlet("a_%d" % (n-2), a, n - 2)
+            g2 = self.spawn_greenlet("a_%d" % (n - 2), a, n - 2)
             g2.get()
 
         yappi.start()
         g = self.spawn_greenlet("a", a, 3)
-        g.get() # run until complete, report exception (if any)
+        g.get()  # run until complete, report exception (if any)
         yappi.stop()
 
         r1 = '''
@@ -239,6 +262,7 @@
         self.assert_ctx_stats_almost_equal(r2, gstats)
 
     def test_recursive_function(self):
+
         def a(n):
             if (n <= 0):
                 return
@@ -280,6 +304,7 @@
         self.assert_ctx_stats_almost_equal(r2, gstats)
 
     def test_exception_raised(self):
+
         def a(n):
             burn_cpu(0.1)
             burn_io_gevent(0.1)
@@ -287,7 +312,7 @@
             if (n == 0):
                 raise Exception
 
-            a(n-1)
+            a(n - 1)
 
         yappi.set_clock_type("cpu")
         yappi.start()
@@ -325,7 +350,6 @@
             burn_cpu(0.1)
             burn_io_gevent(0.1)
 
-
         ev1 = Event()
         ev2 = Event()
         gl = self.spawn_greenlet("a", a, ev1, ev2)
@@ -353,7 +377,6 @@
         '''
         self.assert_ctx_stats_almost_equal(r2, gstats)
 
-
     def test_many_context_switches(self):
 
         def common():
@@ -455,15 +478,14 @@
 
         def driver():
             to_run = [
-                (a, ()),
-                (b, ()),
-                (recursive_a, (5,)),
-                (recursive_a, (5,))
+                (a, ()), (b, ()), (recursive_a, (5, )), (recursive_a, (5, ))
             ]
 
             ts = []
             for idx, (func, args) in enumerate(to_run):
-                t = self.spawn_thread("%s-%d" %  (func.__name__, idx), func, 
*args)
+                t = self.spawn_thread(
+                    "%s-%d" % (func.__name__, idx), func, *args
+                )
                 ts.append(t)
 
             for t in ts:
@@ -520,14 +542,13 @@
 
         def driver():
 
-            to_run = [
-                (recursive_a, (5,)),
-                (recursive_a, (5,))
-            ]
+            to_run = [(recursive_a, (5, )), (recursive_a, (5, ))]
 
             ts = []
             for idx, (func, args) in enumerate(to_run):
-                t = self.spawn_thread("%s_%d" % (func.__name__, idx), func, 
*args)
+                t = self.spawn_thread(
+                    "%s_%d" % (func.__name__, idx), func, *args
+                )
                 ts.append(t)
 
             recursive_a(6)
@@ -558,7 +579,6 @@
         # Set context backend to confgiure default callbacks
         yappi.set_context_backend("greenlet")
 
-
         class GreenletA(gevent.Greenlet):
             pass
 
@@ -598,5 +618,6 @@
         '''
         self.assert_ctx_stats_almost_equal(r2, gstats)
 
+
 if __name__ == '__main__':
     unittest.main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yappi-1.3.6/yappi/_yappi.c 
new/yappi-1.4.0/yappi/_yappi.c
--- old/yappi-1.3.6/yappi/_yappi.c      2022-08-03 10:00:51.000000000 +0200
+++ new/yappi-1.4.0/yappi/_yappi.c      2022-10-31 09:14:14.000000000 +0100
@@ -200,6 +200,15 @@
 
 // funcs
 
+static PyCodeObject *
+FRAME2CODE(PyFrameObject *frame) {
+#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 10
+    return PyFrame_GetCode(frame);
+#else
+    return frame->f_code;
+#endif
+}
+
 static void _DebugPrintObjects(unsigned int arg_count, ...)
 {
     unsigned int i;
@@ -214,9 +223,18 @@
 }
 
 int 
-IS_SUSPENDED(PyFrameObject *frame)
-{
-#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 10
+IS_SUSPENDED(PyFrameObject *frame) {
+#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION == 11
+    PyGenObject *gen = (PyGenObject *)PyFrame_GetGenerator(frame);
+    if (gen == NULL) {
+        return 0;
+    }
+
+    // -1 is FRAME_SUSPENDED. See internal/pycore_frame.h
+    // TODO: Remove these after 3.12 make necessary public APIs.
+    // See 
https://discuss.python.org/t/python-3-11-frame-structure-and-various-changes/17895
+    return gen->gi_frame_state == -1;
+#elif PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION == 10
     return (frame->f_state == FRAME_SUSPENDED);
 #else
     return (frame->f_stacktop != NULL);
@@ -229,11 +247,11 @@
 
 #if defined(IS_PY3K) 
 #if PY_MINOR_VERSION >= 4
-    result = frame->f_code->co_flags & CO_COROUTINE || 
-        frame->f_code->co_flags & CO_ITERABLE_COROUTINE;
+    result = FRAME2CODE(frame)->co_flags & CO_COROUTINE || 
+        FRAME2CODE(frame)->co_flags & CO_ITERABLE_COROUTINE;
 #endif
 #if PY_MINOR_VERSION >= 6
-    result = result || frame->f_code->co_flags & CO_ASYNC_GENERATOR;
+    result = result || FRAME2CODE(frame)->co_flags & CO_ASYNC_GENERATOR;
 #endif
 #endif
 
@@ -644,13 +662,14 @@
     PyCodeObject *cobj;
     _pit *pit;
     _htab *pits;
+    PyObject *co_varnames;
 
     pits = _get_pits_tbl(current_tag);
     if (!pits) {
         return NULL;
     }
 
-    cobj = fobj->f_code;
+    cobj = FRAME2CODE(fobj);
     it = hfind(pits, (uintptr_t)cobj);
     if (it) {
         return ((_pit *)it->val);
@@ -670,7 +689,14 @@
     Py_INCREF(cobj);
 
     if (cobj->co_argcount) {
-        const char *firstarg = 
PyStr_AS_CSTRING(PyTuple_GET_ITEM(cobj->co_varnames, 0));
+        // There has been a lot going on with `co_varnames`, but finally in 
+        // 3.11.0rc1, it is added as a public API
+#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION == 11
+        co_varnames = PyCode_GetVarnames(cobj);
+#else
+        co_varnames = cobj->co_varnames;
+#endif
+        const char *firstarg = PyStr_AS_CSTRING(PyTuple_GET_ITEM(co_varnames, 
0));
 
         if (!strcmp(firstarg, "self")) {
             PyObject* locals = _get_locals(fobj);
@@ -1031,7 +1057,7 @@
     }
 
     // if the function that the frame belongs is a coroutine, we check if we 
RETURN
-    // or YIELD from the coroutine to calculate the correct walltime
+    // or await the coroutine to calculate the correct walltime
     if (IS_ASYNC(frame)) {
         if (IS_SUSPENDED(frame)) {
             yielded = 1;
@@ -1276,15 +1302,38 @@
     ydprintf("resuming context: %ld, shift: %lld", ctx->id, shift);
 }
 
-static _ctx *
-_bootstrap_thread(PyThreadState *ts)
+static void 
+_eval_setprofile(PyThreadState *ts)
 {
-#if PY_VERSION_HEX < 0x030a00b1
+#if PY_VERSION_HEX > 0x030b0000
+    _PyEval_SetProfile(ts, _yapp_callback, NULL);
+#elif PY_VERSION_HEX < 0x030a00b1
     ts->use_tracing = 1;
+    ts->c_profilefunc = _yapp_callback;
 #else
     ts->cframe->use_tracing = 1;
-#endif
     ts->c_profilefunc = _yapp_callback;
+#endif
+}
+
+static void
+_eval_unsetprofile(PyThreadState *ts)
+{
+#if PY_VERSION_HEX > 0x030b0000
+    _PyEval_SetProfile(ts, NULL, NULL);
+#elif PY_VERSION_HEX < 0x030a00b1
+    ts->use_tracing = 0;
+    ts->c_profilefunc = NULL;
+#else
+    ts->cframe->use_tracing = 0;
+    ts->c_profilefunc = NULL;
+#endif
+}
+
+static _ctx *
+_bootstrap_thread(PyThreadState *ts)
+{
+    _eval_setprofile(ts);
     return NULL;
 }
 
@@ -1313,13 +1362,7 @@
     } else {
         ctx = (_ctx *)it->val;
     }
-    
-#if PY_VERSION_HEX < 0x030a00b1
-    ts->use_tracing = 1;
-#else
-    ts->cframe->use_tracing = 1;
-#endif
-    ts->c_profilefunc = _yapp_callback;
+    _eval_setprofile(ts);
     ctx->id = ctx_id;
     ctx->tid = ts->thread_id;
     ctx->ts_ptr = ts;
@@ -1335,12 +1378,7 @@
 static _ctx*
 _unprofile_thread(PyThreadState *ts)
 {
-#if PY_VERSION_HEX < 0x030a00b1
-    ts->use_tracing = 0;
-#else
-    ts->cframe->use_tracing = 0;
-#endif
-    ts->c_profilefunc = NULL;
+    _eval_unsetprofile(ts);
 
     return NULL; //dummy return for enum_threads() func. prototype
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yappi-1.3.6/yappi/timing.c 
new/yappi-1.4.0/yappi/timing.c
--- old/yappi-1.3.6/yappi/timing.c      2022-08-03 10:00:51.000000000 +0200
+++ new/yappi-1.4.0/yappi/timing.c      2022-10-31 09:14:14.000000000 +0100
@@ -81,13 +81,12 @@
 
     rc = 0;
     if (g_clock_type == CPU_CLOCK) {
-        kern_return_t kr;
         thread_basic_info_t tinfo_b;
         thread_info_data_t tinfo_d;
         mach_msg_type_number_t tinfo_cnt;
 
         tinfo_cnt = THREAD_INFO_MAX;
-        kr = thread_info(mach_thread_self(), THREAD_BASIC_INFO, 
(thread_info_t)tinfo_d, &tinfo_cnt);
+        thread_info(mach_thread_self(), THREAD_BASIC_INFO, 
(thread_info_t)tinfo_d, &tinfo_cnt);
         tinfo_b = (thread_basic_info_t)tinfo_d;
 
         if (!(tinfo_b->flags & TH_FLAGS_IDLE))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yappi-1.3.6/yappi/yappi.egg-info/PKG-INFO 
new/yappi-1.4.0/yappi/yappi.egg-info/PKG-INFO
--- old/yappi-1.3.6/yappi/yappi.egg-info/PKG-INFO       2022-08-03 
10:01:12.000000000 +0200
+++ new/yappi-1.4.0/yappi/yappi.egg-info/PKG-INFO       2022-10-31 
09:14:26.000000000 +0100
@@ -1,12 +1,12 @@
 Metadata-Version: 2.1
 Name: yappi
-Version: 1.3.6
+Version: 1.4.0
 Summary: Yet Another Python Profiler
 Home-page: https://github.com/sumerc/yappi
-Author: Sumer Cip
+Author: Sümer Cip
 Author-email: sum...@gmail.com
 License: MIT
-Keywords: python thread multithread profiler
+Keywords: python thread multithread asyncio gevent profiler
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Console
 Classifier: Intended Audience :: Developers
@@ -33,13 +33,14 @@
 
 <h1 align="center">Yappi</h1>
 <p align="center">
-    A tracing profiler that is <b>thread&coroutine&greenlet</b> aware.
+    A tracing profiler that is <b>multithreading, asyncio and gevent</b> aware.
 </p>
 
 <p align="center">
     <img src="https://www.travis-ci.org/sumerc/yappi.svg?branch=master";>
     <img 
src="https://github.com/sumerc/yappi/workflows/CI/badge.svg?branch=master";>
     <img src="https://img.shields.io/pypi/v/yappi.svg";>
+    <img src="https://img.shields.io/pypi/dw/yappi.svg";>
     <img src="https://img.shields.io/pypi/pyversions/yappi.svg";>
     <img src="https://img.shields.io/github/last-commit/sumerc/yappi.svg";>
     <img src="https://img.shields.io/github/license/sumerc/yappi.svg";>
@@ -47,12 +48,12 @@
 
 ## Highlights
 
-- **Fast**: Yappi is fast. It is completely written in C and lots of love&care 
went into making it fast.
+- **Fast**: Yappi is fast. It is completely written in C and lots of love and 
care went into making it fast.
 - **Unique**: Yappi supports multithreaded, 
[asyncio](https://github.com/sumerc/yappi/blob/master/doc/coroutine-profiling.md)
 and 
[gevent](https://github.com/sumerc/yappi/blob/master/doc/greenlet-profiling.md) 
profiling. Tagging/filtering multiple profiler results has interesting [use 
cases](https://github.com/sumerc/yappi/blob/master/doc/api.md#set_tag_callback).
 - **Intuitive**: Profiler can be started/stopped and results can be obtained 
from any time and any thread.
 - **Standards Compliant**: Profiler results can be saved in 
[callgrind](http://valgrind.org/docs/manual/cl-format.html) or 
[pstat](http://docs.python.org/3.4/library/profile.html#pstats.Stats) formats.
 - **Rich in Feature set**: Profiler results can show either [Wall 
Time](https://en.wikipedia.org/wiki/Elapsed_real_time) or actual [CPU 
Time](http://en.wikipedia.org/wiki/CPU_time) and can be aggregated from 
different sessions. Various flags are defined for filtering and sorting 
profiler results.
-- **Robust**: Yappi had seen years of production usage.
+- **Robust**: Yappi has been around for years.
 
 ## Motivation
 

Reply via email to