(cls, interpreter=None)
| 248 | class LocalInterpreter(Target): |
| 249 | @classmethod |
| 250 | def create(cls, interpreter=None): |
| 251 | # type: (Optional[Union[str, PythonInterpreter]]) -> LocalInterpreter |
| 252 | |
| 253 | if not interpreter: |
| 254 | python_interpreter = PythonInterpreter.get() |
| 255 | elif isinstance(interpreter, PythonInterpreter): |
| 256 | python_interpreter = interpreter |
| 257 | else: |
| 258 | python_interpreter = PythonInterpreter.from_binary(interpreter) |
| 259 | |
| 260 | return cls( |
| 261 | id=python_interpreter.binary.replace(os.sep, ".").lstrip("."), |
| 262 | platform=python_interpreter.platform, |
| 263 | marker_environment=python_interpreter.identity.env_markers, |
| 264 | interpreter=python_interpreter, |
| 265 | ) |
| 266 | |
| 267 | interpreter = attr.ib() # type: PythonInterpreter |
| 268 |
no test coverage detected