FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnet/clr.py at master · tminka/pythonnet · GitHub
tminka
pythonnet
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnet
/
clr.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
41 lines (27 loc) · 816 Bytes
Breadcrumbs
pythonnet
/
clr.py
Copy path
File metadata and controls
41 lines (27 loc) · 816 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
Legacy Python.NET loader for backwards compatibility
"""
def
_get_netfx_path
():
import
os
,
sys
if
sys
.
maxsize
>
2
**
32
:
arch
=
"amd64"
else
:
arch
=
"x86"
return
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"pythonnet"
,
"netfx"
,
arch
,
"clr.pyd"
)
def
_get_mono_path
():
import
os
,
glob
paths
=
glob
.
glob
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"pythonnet"
,
"mono"
,
"clr.*so"
))
return
paths
[
0
]
def
_load_clr
():
import
sys
from
importlib
import
util
if
sys
.
platform
==
"win32"
:
path
=
_get_netfx_path
()
else
:
path
=
_get_mono_path
()
del
sys
.
modules
[
__name__
]
spec
=
util
.
spec_from_file_location
(
"clr"
,
path
)
clr
=
util
.
module_from_spec
(
spec
)
spec
.
loader
.
exec_module
(
clr
)
sys
.
modules
[
__name__
]
=
clr
_load_clr
()
Back
|
FazBrowse Home
|
New Git URL