Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Create stub resolver before builtins #723

Merged
merged 1 commit into from
Mar 11, 2019

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented Mar 8, 2019

Fixes #719.

Looking at the stack trace on that issue, Initialize occurs, which eventually gets an AST, which then spawns a task which eventually calls CreateModule, which refers back to PythonInterpreter, whose stub resolver has not yet been instantiated. I don't believe instantiating it earlier has any effect other than that it's there earlier so won't be null, as InitializeAsync only sets up an internal path resolver.

I'm not really sure if this is the "true" fix, since it seems weird for there to be this sort of cycle, but I'm not the most familiar with this specific bit.

@AlexanderSher
Copy link
Contributor

I don't think there is any harm of initializing Typeshed earlier, but the bug looks quite weird. __builtin__ module shouldn't have any dependencies at all.

@jakebailey jakebailey merged commit 63b6e30 into microsoft:master Mar 11, 2019
@jakebailey jakebailey deleted the stubres-before-builtins branch March 11, 2019 04:25
jakebailey added a commit to jakebailey/python-language-server that referenced this pull request Nov 1, 2019
Fixes microsoft#719.

Looking at the stack trace on that issue, `Initialize` occurs, which eventually gets an AST, which then spawns a task which eventually calls `CreateModule`, which refers back to `PythonInterpreter`, whose stub resolver has not yet been instantiated. I don't believe instantiating it earlier has any effect other than that it's there earlier so won't be `null`, as `InitializeAsync` only sets up an internal path resolver.

I'm not really sure if this is the "true" fix, since it seems weird for there to be this sort of cycle, but I'm not the most familiar with this specific bit.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scraper produces incorrect output for the Anaconda 2X builtin
3 participants