Re: _init_posix() not ever called?
M A <[email protected]> Tue, 21 Sep 2021 06:36:29 -0400
| Newsgroups | gmane.comp.python.pypy |
|---|---|
| Message-ID | <[email protected]> |
> On Sep 21, 2021, at 4:28 AM, Armin Rigo <[email protected]> wrote: > > Hi, > > On Mon, 20 Sept 2021 at 22:33, M A <[email protected]> wrote: >> Hi I was working in the file lib-python/2.7/distutils/sysconfig_pypy.py, on the function _init_posix(). I placed print() statements in the function to indicate when this function is called. After fully building pypy the print() statements were never called. I then used grep to try to find out where this function is called in the source code. I ran this command: grep "_init_posix()" -r *. After looking at the results it looks like this function is never called by anything. Why do we have it? More importantly can we delete it? > > It is called from the same file by these line: > > func = globals().get("_init_" + os.name) > if func: > func() > > If you don't see print statements at runtime, then it might be the > case that it's called at translation time instead. The module's state > with _init_posix() already called would then get frozen inside the > translated pypy. > > > A bientôt, > Armin Thank you Armin. So how do I make this function run again? For most projects I would be something like "make clean" to remove all the object files and start from the beginning. Does PyPy have anything like this? _______________________________________________ pypy-dev mailing list [email protected] https://mail.python.org/mailman/listinfo/pypy-dev