CodeQL library for Python
codeql/python-all 2.1.1-dev (changelog, source)
Search

Member predicate ImportExpr::getLevel

Gets the level of this import.

The language specifies level as -1 if relative imports are to be tried first, 0 for absolute imports, and level > 0 for explicit relative imports.

int getLevel()