File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change 29
29
import bson # noqa: E402
30
30
import pymongo # noqa: E402
31
31
32
- if not pymongo .has_c () or not bson .has_c ():
33
- try :
34
- from pymongo import _cmessage # type:ignore[attr-defined] # noqa: F401
35
- except Exception as e :
36
- LOGGER .exception (e )
37
- try :
38
- from bson import _cbson # type:ignore[attr-defined] # noqa: F401
39
- except Exception as e :
40
- LOGGER .exception (e )
41
- sys .exit ("could not load C extensions" )
32
+
33
+ def main ():
34
+ if not pymongo .has_c () or not bson .has_c ():
35
+ try :
36
+ from pymongo import _cmessage # type:ignore[attr-defined] # noqa: F401
37
+ except Exception as e :
38
+ LOGGER .exception (e )
39
+ try :
40
+ from bson import _cbson # type:ignore[attr-defined] # noqa: F401
41
+ except Exception as e :
42
+ LOGGER .exception (e )
43
+ sys .exit ("could not load C extensions" )
44
+
45
+
46
+ if __name__ == "__main__" :
47
+ main ()
You can’t perform that action at this time.
0 commit comments