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
03a144bb
Kaydet (Commit)
03a144bb
authored
Ara 16, 2014
tarafından
Steve Dower
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#22980 Adds platform and version tags to .pyd files
üst
09bd9ec9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
4 deletions
+52
-4
test_windows.py
Lib/test/test_importlib/test_windows.py
+24
-0
NEWS
Misc/NEWS
+3
-0
pyconfig.h
PC/pyconfig.h
+4
-0
python.props
PCbuild/python.props
+4
-0
dynload_win.c
Python/dynload_win.c
+17
-4
No files found.
Lib/test/test_importlib/test_windows.py
Dosyayı görüntüle @
03a144bb
...
...
@@ -2,9 +2,11 @@ from . import util as test_util
machinery
=
test_util
.
import_importlib
(
'importlib.machinery'
)
import
os
import
re
import
sys
import
unittest
from
test
import
support
from
distutils.util
import
get_platform
from
contextlib
import
contextmanager
from
.util
import
temp_module
...
...
@@ -83,3 +85,25 @@ class WindowsRegistryFinderTests:
(
Frozen_WindowsRegistryFinderTests
,
Source_WindowsRegistryFinderTests
)
=
test_util
.
test_both
(
WindowsRegistryFinderTests
,
machinery
=
machinery
)
@unittest.skipUnless
(
sys
.
platform
.
startswith
(
'win'
),
'requires Windows'
)
class
WindowsExtensionSuffixTests
:
def
test_tagged_suffix
(
self
):
suffixes
=
self
.
machinery
.
EXTENSION_SUFFIXES
expected_tag
=
".cp{0.major}{0.minor}-{1}.pyd"
.
format
(
sys
.
version_info
,
re
.
sub
(
'[^a-zA-Z0-9]'
,
'_'
,
get_platform
()))
try
:
untagged_i
=
suffixes
.
index
(
".pyd"
)
except
ValueError
:
untagged_i
=
suffixes
.
index
(
"_d.pyd"
)
expected_tag
=
"_d"
+
expected_tag
self
.
assertIn
(
expected_tag
,
suffixes
)
# Ensure the tags are in the correct order
tagged_i
=
suffixes
.
index
(
expected_tag
)
self
.
assertLess
(
tagged_i
,
untagged_i
)
(
Frozen_WindowsExtensionSuffixTests
,
Source_WindowsExtensionSuffixTests
)
=
test_util
.
test_both
(
WindowsExtensionSuffixTests
,
machinery
=
machinery
)
Misc/NEWS
Dosyayı görüntüle @
03a144bb
...
...
@@ -1584,6 +1584,9 @@ Windows
- Issue #10747: Use versioned labels in the Windows start menu.
Patch by Olive Kilburn.
- Issue #22980: .pyd files with a version and platform tag (for example,
"
.
cp35
-
win32
.
pyd
") will now be loaded in preference to those without tags.
What's New in Python 3.4.0?
===========================
...
...
PC/pyconfig.h
Dosyayı görüntüle @
03a144bb
...
...
@@ -145,9 +145,11 @@ WIN32 is still required for the locale module.
#if defined(_M_IA64)
#define COMPILER _Py_PASTE_VERSION("64 bit (Itanium)")
#define MS_WINI64
#define PYD_PLATFORM_TAG "win_ia64"
#elif defined(_M_X64) || defined(_M_AMD64)
#define COMPILER _Py_PASTE_VERSION("64 bit (AMD64)")
#define MS_WINX64
#define PYD_PLATFORM_TAG "win_amd64"
#else
#define COMPILER _Py_PASTE_VERSION("64 bit (Unknown)")
#endif
...
...
@@ -193,8 +195,10 @@ typedef _W64 int ssize_t;
#if defined(MS_WIN32) && !defined(MS_WIN64)
#if defined(_M_IX86)
#define COMPILER _Py_PASTE_VERSION("32 bit (Intel)")
#define PYD_PLATFORM_TAG "win32"
#elif defined(_M_ARM)
#define COMPILER _Py_PASTE_VERSION("32 bit (ARM)")
#define PYD_PLATFORM_TAG "win_arm"
#else
#define COMPILER _Py_PASTE_VERSION("32 bit (Unknown)")
#endif
...
...
PCbuild/python.props
Dosyayı görüntüle @
03a144bb
...
...
@@ -96,6 +96,10 @@
<!-- The name of the resulting pythonXY.dll (without the extension) -->
<PyDllName>
python$(MajorVersionNumber)$(MinorVersionNumber)$(PyDebugExt)
</PyDllName>
<!-- The version and platform tag to include in .pyd filenames -->
<PydTag
Condition=
"$(Platform) == 'Win32'"
>
.cp$(MajorVersionNumber)$(MinorVersionNumber)-win32
</PydTag>
<PydTag
Condition=
"$(Platform) == 'x64'"
>
.cp$(MajorVersionNumber)$(MinorVersionNumber)-win_amd64
</PydTag>
</PropertyGroup>
<!-- Displays the calculated version info -->
...
...
Python/dynload_win.c
Dosyayı görüntüle @
03a144bb
...
...
@@ -9,6 +9,7 @@
#include <ctype.h>
#include "importdl.h"
#include "patchlevel.h"
#include <windows.h>
// "activation context" magic - see dl_nt.c...
...
...
@@ -17,16 +18,28 @@ extern ULONG_PTR _Py_ActivateActCtx();
void
_Py_DeactivateActCtx
(
ULONG_PTR
cookie
);
#endif
const
char
*
_PyImport_DynLoadFiletab
[]
=
{
#ifdef _DEBUG
"_d.pyd"
,
#define PYD_DEBUG_SUFFIX "_d"
#else
#define PYD_DEBUG_SUFFIX ""
#endif
#define STRINGIZE2(x) #x
#define STRINGIZE(x) STRINGIZE2(x)
#ifdef PYD_PLATFORM_TAG
#define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cp" STRINGIZE(PY_MAJOR_VERSION) STRINGIZE(PY_MINOR_VERSION) "-" PYD_PLATFORM_TAG ".pyd"
#else
".pyd"
,
#define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cp" STRINGIZE(PY_MAJOR_VERSION) STRINGIZE(PY_MINOR_VERSION) ".pyd"
#endif
#define PYD_UNTAGGED_SUFFIX PYD_DEBUG_SUFFIX ".pyd"
const
char
*
_PyImport_DynLoadFiletab
[]
=
{
PYD_TAGGED_SUFFIX
,
PYD_UNTAGGED_SUFFIX
,
NULL
};
/* Case insensitive string compare, to avoid any dependencies on particular
C RTL implementations */
...
...
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