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
ffa1a77c
Kaydet (Commit)
ffa1a77c
authored
Şub 26, 2011
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #11258: Speed up ctypes.util.find_library() under Linux a lot. Patch
by Jonas H.
üst
ec5a2d5e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
7 deletions
+22
-7
test_loading.py
Lib/ctypes/test/test_loading.py
+7
-0
util.py
Lib/ctypes/util.py
+11
-7
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/ctypes/test/test_loading.py
Dosyayı görüntüle @
ffa1a77c
...
@@ -102,5 +102,12 @@ class LoaderTest(unittest.TestCase):
...
@@ -102,5 +102,12 @@ class LoaderTest(unittest.TestCase):
# This is the real test: call the function via 'call_function'
# This is the real test: call the function via 'call_function'
self
.
assertEqual
(
0
,
call_function
(
proc
,
(
None
,)))
self
.
assertEqual
(
0
,
call_function
(
proc
,
(
None
,)))
if
os
.
name
!=
"nt"
:
def
test_libc_exists
(
self
):
# A basic test that the libc is found by find_library()
# XXX Can this fail on some non-Windows systems?
self
.
assertTrue
(
libc_name
)
self
.
assertTrue
(
os
.
path
.
exists
(
libc_name
))
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
unittest
.
main
()
unittest
.
main
()
Lib/ctypes/util.py
Dosyayı görüntüle @
ffa1a77c
...
@@ -203,14 +203,18 @@ elif os.name == "posix":
...
@@ -203,14 +203,18 @@ elif os.name == "posix":
abi_type
=
mach_map
.
get
(
machine
,
'libc6'
)
abi_type
=
mach_map
.
get
(
machine
,
'libc6'
)
# XXX assuming GLIBC's ldconfig (with option -p)
# XXX assuming GLIBC's ldconfig (with option -p)
expr
=
r'(\S+)\s+\((
%
s(?:, OS ABI:[^\)]*)?)\)[^/]*(/[^\(\)\s]*lib
%
s\.[^\(\)\s]*)'
\
name
=
'lib
%
s'
%
name
%
(
abi_type
,
re
.
escape
(
name
))
pat
=
re
.
compile
(
'
\
s*(/[^
\
(
\
)
\
s]*
%
s
\
.[^
\
(
\
)
\
s]*)'
%
re
.
escape
(
name
))
with
contextlib
.
closing
(
os
.
popen
(
'LC_ALL=C LANG=C /sbin/ldconfig -p 2>/dev/null'
))
as
f
:
with
contextlib
.
closing
(
os
.
popen
(
'LC_ALL=C LANG=C /sbin/ldconfig -p 2>/dev/null'
))
as
f
:
data
=
f
.
read
()
for
line
in
f
:
res
=
re
.
search
(
expr
,
data
)
if
not
'=>'
in
line
:
if
not
res
:
continue
return
None
path
=
line
.
rsplit
(
'=>'
,
1
)[
1
]
return
res
.
group
(
1
)
if
not
name
+
'.'
in
path
:
continue
res
=
pat
.
search
(
path
)
if
res
:
return
res
.
group
(
1
)
def
find_library
(
name
):
def
find_library
(
name
):
return
_findSoname_ldconfig
(
name
)
or
_get_soname
(
_findLib_gcc
(
name
))
return
_findSoname_ldconfig
(
name
)
or
_get_soname
(
_findLib_gcc
(
name
))
...
...
Misc/ACKS
Dosyayı görüntüle @
ffa1a77c
...
@@ -329,6 +329,7 @@ Dag Gruneau
...
@@ -329,6 +329,7 @@ Dag Gruneau
Michael Guravage
Michael Guravage
Lars Gustäbel
Lars Gustäbel
Thomas Güttler
Thomas Güttler
Jonas H.
Barry Haddow
Barry Haddow
Paul ten Hagen
Paul ten Hagen
Rasmus Hahn
Rasmus Hahn
...
...
Misc/NEWS
Dosyayı görüntüle @
ffa1a77c
...
@@ -35,6 +35,9 @@ Core and Builtins
...
@@ -35,6 +35,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #11258: Speed up ctypes.util.find_library() under Linux a lot. Patch
by Jonas H.
- Issue #11297: Add collections.ChainMap().
- Issue #11297: Add collections.ChainMap().
- Issue #10755: Add the posix.fdlistdir() function. Patch by Ross Lagerwall.
- Issue #10755: Add the posix.fdlistdir() function. Patch by Ross Lagerwall.
...
...
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