mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 23:31:05 +07:00
sys.version_info guards are processed at the level of ScopeImpl.collectDeclarations and PyResolveUtil.scopeCrawlUp in PyReferenceImpl.resolveInner, as implemented in 3318ff79cdcc5ba0ce5e4feb65abad5ad0f4acfa. However, once we collected all name definition candidates flow-insensitively this way, in PyReferenceImpl.getResultsFromProcessor, if the reference and these candidates were located in the same scope, we completely ignored these variants and gathered reachable definitions all over again from CFG using PyDefUseUtil.getLatestDefs. And the latter didn't consider version guards at all. I've added version guard checks directly in PyDefUseUtil.getLatestDefs. GitOrigin-RevId: 9f92eecd1eb1812bfbd2bf54f8192f45f0cf0a1d