-
Notifications
You must be signed in to change notification settings - Fork 890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error is raised at for _name, _value in list(globals().items()):
in yapf_third_party/_ylib2to3/pgen2/token.py
#1118
Comments
Please add a code snippet that replicates this error. |
I'm not using yapf directly and this error is raised only if some conditions are meet (I don't know which condition it is).
|
Unable to reproduce kyle@mainstay:~/Repos$ pipx run --no-cache yapf <<EOF
import importlib
import multiprocessing as mp
def test():
print("import start")
importlib.import_module("yapf.yapflib.yapf_api")
print("import end")
def main():
spawn_mp = mp.get_context("spawn")
p = spawn_mp.Process(target=test)
p.start()
p.join()
if __name__ == "__main__":
main()
EOF
⚠️ yapf is already on your PATH and installed at /home/kyle/.local/bin/yapf. Downloading and running anyway.
import importlib
import multiprocessing as mp
def test():
print("import start")
importlib.import_module("yapf.yapflib.yapf_api")
print("import end")
def main():
spawn_mp = mp.get_context("spawn")
p = spawn_mp.Process(target=test)
p.start()
p.join()
if __name__ == "__main__":
main()
kyle@mainstay:~/Repos$ |
Merged
bwendling
pushed a commit
that referenced
this issue
Sep 25, 2023
Fixes #1118. Use a copy of globals() rather than a direct reference. This did not appear to impact the time of tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I got an error when importing yapf whose version is 0.40.1
When the yapf is imported, yapf_third_party/_ylib2to3/pgen2/token.py is executed
and then error is raised as below.
I think it occurs to other people also scipy/scipy#11479
Something weird is it appears not in all cases.
It can be solved easily if
for _name, _value in list(globals().items()):
is changed tofor _name, _value in list(globals().copy().items()):
.Could you fix this bug?
The text was updated successfully, but these errors were encountered: