Skip to content

Commit b614b0a

Browse files
committed
fix msgspec._core checker in main.py
1 parent 7a213a5 commit b614b0a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

main.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414

1515
sys.path.append(libs_path)
1616

17-
from plugin.plugin import RtfmPlugin # noqa: E402
18-
1917
# Since msgspec is primarily written in C and uses pyd files, the pyd files need to be generated for the user's system
2018
# So if msgspec._core can not be imported, force reinstall the package on the user's system so that the proper pyd files are generated.
2119

2220
try:
2321
import msgspec._core # noqa: F401
24-
except ImportError:
22+
except ModuleNotFoundError:
2523
import subprocess
2624

2725
subprocess.run(
@@ -35,8 +33,12 @@
3533
"msgspec",
3634
"-t",
3735
libs_path,
38-
]
36+
],
37+
stdout=subprocess.DEVNULL,
38+
stderr=subprocess.DEVNULL,
3939
)
4040

41+
from plugin.plugin import RtfmPlugin # noqa: E402
42+
4143
if __name__ == "__main__":
4244
RtfmPlugin().run()

0 commit comments

Comments
 (0)