Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
bd305e49
Kaydet (Commit)
bd305e49
authored
Haz 14, 2016
tarafından
Martin Panter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #22636: Merge ctypes.util from 3.5
üst
ed80db57
e1b3431c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
19 deletions
+35
-19
util.py
Lib/ctypes/util.py
+35
-19
No files found.
Lib/ctypes/util.py
Dosyayı görüntüle @
bd305e49
...
...
@@ -115,10 +115,13 @@ elif os.name == "posix":
env
=
dict
(
os
.
environ
)
env
[
'LC_ALL'
]
=
'C'
env
[
'LANG'
]
=
'C'
proc
=
subprocess
.
Popen
(
args
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
env
=
env
)
try
:
proc
=
subprocess
.
Popen
(
args
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
env
=
env
)
except
OSError
:
# E.g. bad executable
return
None
with
proc
:
trace
=
proc
.
stdout
.
read
()
finally
:
...
...
@@ -140,9 +143,12 @@ elif os.name == "posix":
if
not
f
:
return
None
proc
=
subprocess
.
Popen
((
"/usr/ccs/bin/dump"
,
"-Lpv"
,
f
),
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
DEVNULL
)
try
:
proc
=
subprocess
.
Popen
((
"/usr/ccs/bin/dump"
,
"-Lpv"
,
f
),
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
DEVNULL
)
except
OSError
:
# E.g. command not found
return
None
with
proc
:
data
=
proc
.
stdout
.
read
()
res
=
re
.
search
(
br
'
\
[.*
\
]
\
sSONAME
\
s+([^
\
s]+)'
,
data
)
...
...
@@ -159,9 +165,12 @@ elif os.name == "posix":
# objdump is not available, give up
return
None
proc
=
subprocess
.
Popen
((
objdump
,
'-p'
,
'-j'
,
'.dynamic'
,
f
),
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
DEVNULL
)
try
:
proc
=
subprocess
.
Popen
((
objdump
,
'-p'
,
'-j'
,
'.dynamic'
,
f
),
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
DEVNULL
)
except
OSError
:
# E.g. bad executable
return
None
with
proc
:
dump
=
proc
.
stdout
.
read
()
res
=
re
.
search
(
br
'
\
sSONAME
\
s+([^
\
s]+)'
,
dump
)
...
...
@@ -187,11 +196,15 @@ elif os.name == "posix":
expr
=
r':-l
%
s\.\S+ => \S*/(lib
%
s\.\S+)'
%
(
ename
,
ename
)
expr
=
os
.
fsencode
(
expr
)
proc
=
subprocess
.
Popen
((
'/sbin/ldconfig'
,
'-r'
),
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
DEVNULL
)
with
proc
:
data
=
proc
.
stdout
.
read
()
try
:
proc
=
subprocess
.
Popen
((
'/sbin/ldconfig'
,
'-r'
),
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
DEVNULL
)
except
OSError
:
# E.g. command not found
data
=
b
''
else
:
with
proc
:
data
=
proc
.
stdout
.
read
()
res
=
re
.
findall
(
expr
,
data
)
if
not
res
:
...
...
@@ -214,10 +227,13 @@ elif os.name == "posix":
args
=
(
'/usr/bin/crle'
,)
paths
=
None
proc
=
subprocess
.
Popen
(
args
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
DEVNULL
,
env
=
env
)
try
:
proc
=
subprocess
.
Popen
(
args
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
DEVNULL
,
env
=
env
)
except
OSError
:
# E.g. bad executable
return
None
with
proc
:
for
line
in
proc
.
stdout
:
line
=
line
.
strip
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment