Fix invalid escape sequence (#17145)

### Description
- Removed one unused import
- Escaped a backslash in a path

### Motivation and Context
I see this `DeprecationWarning` when I import `onnxruntime`:

```
onnxruntime/capi/_pybind_state.py:28: DeprecationWarning: invalid escape sequence '\S'
    "(other than %SystemRoot%\System32), "
```

A future version of Python (maybe 3.13?) will raise a `SyntaxError` for
invalid escape sequences.
This commit is contained in:
Severin Simmler 2023-08-15 19:29:54 +02:00 committed by GitHub
parent 3aba736ee2
commit 90754fc077
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,6 @@ Ensure that dependencies are available and then load the extension module.
"""
import os
import platform
import sys
import warnings
from . import _ld_preload # noqa: F401
@ -25,7 +24,7 @@ if platform.system() == "Windows":
if not os.path.isfile(os.path.join(system_root, "System32", "vcruntime140_1.dll")):
warnings.warn("Please install the 2019 Visual C++ runtime and then try again. "
"If you've installed the runtime in a non-standard location "
"(other than %SystemRoot%\System32), "
"(other than %SystemRoot%\\System32), "
"make sure it can be found by setting the correct path.")
@ONNXRUNTIME_IMPORT_PYTORCH_TO_RESOLVE_DLLS@