Skip to content

Commit

Permalink
Try to fix cyclic import for typing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Nov 6, 2024
1 parent 9aba065 commit 72a484a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mesonbuild/linkers/linkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from .base import ArLikeLinker, RSPFileSyntax
from .. import mesonlib
from ..mesonlib import EnvironmentException, MesonException
from ..arglist import CompilerArgs

if T.TYPE_CHECKING:
from ..environment import Environment

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
Expand All @@ -30,7 +29,9 @@ def __init__(self, exelist: T.List[str]):
def get_id(self) -> str:
return self.id

def compiler_args(self, args: T.Optional[T.Iterable[str]] = None) -> CompilerArgs:
# Types are not correct because of cyclic imports.
def compiler_args(self, args: T.Optional[T.Iterable[str]] = None) -> T.Any:
from ..arglist import CompilerArgs
return CompilerArgs(self, args)

def can_linker_accept_rsp(self) -> bool:
Expand Down

0 comments on commit 72a484a

Please sign in to comment.