Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7af53c36
Commit
7af53c36
authored
Dec 14, 2012
by
Andrew Svetlov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #16421: allow to load multiple modules from the same shared object.
Patch by Václav Šmilauer.
parent
73c1a856
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
887 additions
and
10 deletions
+887
-10
Lib/test/test_imp.py
Lib/test/test_imp.py
+14
-0
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+4
-0
Modules/_testimportmultiple.c
Modules/_testimportmultiple.c
+57
-0
PC/VS9.0/_testimportmultiple.vcproj
PC/VS9.0/_testimportmultiple.vcproj
+521
-0
PC/VS9.0/pcbuild.sln
PC/VS9.0/pcbuild.sln
+21
-0
PCbuild/_testimportmultiple.vcxproj
PCbuild/_testimportmultiple.vcxproj
+218
-0
PCbuild/_testimportmultiple.vcxproj.filters
PCbuild/_testimportmultiple.vcxproj.filters
+13
-0
PCbuild/pcbuild.sln
PCbuild/pcbuild.sln
+18
-0
Python/import.c
Python/import.c
+17
-10
Tools/msi/msi.py
Tools/msi/msi.py
+1
-0
setup.py
setup.py
+2
-0
No files found.
Lib/test/test_imp.py
View file @
7af53c36
...
...
@@ -217,6 +217,20 @@ class ImportTests(unittest.TestCase):
mod
=
imp
.
load_module
(
example
,
*
x
)
self
.
assertEqual
(
mod
.
__name__
,
example
)
def
test_issue16421_multiple_modules_in_one_dll
(
self
):
# Issue 16421: loading several modules from the same compiled file fails
m
=
'_testimportmultiple'
fileobj
,
pathname
,
description
=
imp
.
find_module
(
m
)
fileobj
.
close
()
mod0
=
imp
.
load_dynamic
(
m
,
pathname
)
mod1
=
imp
.
load_dynamic
(
'foo'
,
pathname
)
mod2
=
imp
.
load_dynamic
(
'bar'
,
pathname
)
self
.
assertEqual
(
mod0
.
__name__
,
m
)
self
.
assertEqual
(
mod1
.
__name__
,
'foo'
)
self
.
assertEqual
(
mod2
.
__name__
,
'bar'
)
with
self
.
assertRaises
(
ImportError
):
imp
.
load_dynamic
(
'nonexistent'
,
pathname
)
def
test_load_dynamic_ImportError_path
(
self
):
# Issue #1559549 added `name` and `path` attributes to ImportError
# in order to provide better detail. Issue #10854 implemented those
...
...
Misc/ACKS
View file @
7af53c36
...
...
@@ -1109,6 +1109,7 @@ George Sipe
J. Sipprell
Kragen Sitaker
Michael Sloan
Václav Šmilauer
Christopher Smith
Eric V. Smith
Gregory P. Smith
...
...
Misc/NEWS
View file @
7af53c36
...
...
@@ -10,6 +10,10 @@ What's New in Python 3.4.0 Alpha 1?
Core and Builtins
-----------------
- Issue #16421: loading multiple modules from one shared object is now
handled correctly (previously, the first module loaded from that file
was silently returned). Patch by Václav Šmilauer.
- Issue #16602: When a weakref'
s
target
was
part
of
a
long
deallocation
chain
,
the
object
could
remain
reachable
through
its
weakref
even
though
its
refcount
had
dropped
to
zero
.
...
...
Modules/_testimportmultiple.c
0 → 100644
View file @
7af53c36
/*
* C extensions module to test importing multiple modules from one compiled
* file (issue16421). This file defines 3 modules (_testimportmodule,
* foo, bar), only the first one is called the same as the compiled file.
*/
#include<Python.h>
static
struct
PyModuleDef
_testimportmultiple
=
{
PyModuleDef_HEAD_INIT
,
"_testimportmultiple"
,
"_testimportmultiple doc"
,
-
1
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
};
PyMODINIT_FUNC
PyInit__testimportmultiple
()
{
return
PyModule_Create
(
&
_testimportmultiple
);
}
static
struct
PyModuleDef
_foomodule
=
{
PyModuleDef_HEAD_INIT
,
"foo"
,
"foo doc"
,
-
1
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
};
PyMODINIT_FUNC
PyInit_foo
()
{
return
PyModule_Create
(
&
_foomodule
);
}
static
struct
PyModuleDef
_barmodule
=
{
PyModuleDef_HEAD_INIT
,
"bar"
,
"bar doc"
,
-
1
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
};
PyMODINIT_FUNC
PyInit_bar
(){
return
PyModule_Create
(
&
_barmodule
);
}
PC/VS9.0/_testimportmultiple.vcproj
0 → 100644
View file @
7af53c36
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType=
"Visual C++"
Version=
"9.00"
Name=
"_testimportmultiple"
ProjectGUID=
"{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}"
RootNamespace=
"_testimportmultiple"
Keyword=
"Win32Proj"
TargetFrameworkVersion=
"196613"
>
<Platforms>
<Platform
Name=
"Win32"
/>
<Platform
Name=
"x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name=
"Debug|Win32"
ConfigurationType=
"2"
InheritedPropertySheets=
".\pyd_d.vsprops"
CharacterSet=
"0"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCCLCompilerTool"
/>
<Tool
Name=
"VCManagedResourceCompilerTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCLinkerTool"
BaseAddress=
"0x1e1F0000"
/>
<Tool
Name=
"VCALinkTool"
/>
<Tool
Name=
"VCManifestTool"
/>
<Tool
Name=
"VCXDCMakeTool"
/>
<Tool
Name=
"VCBscMakeTool"
/>
<Tool
Name=
"VCFxCopTool"
/>
<Tool
Name=
"VCAppVerifierTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name=
"Debug|x64"
ConfigurationType=
"2"
InheritedPropertySheets=
".\pyd_d.vsprops;.\x64.vsprops"
CharacterSet=
"0"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCMIDLTool"
TargetEnvironment=
"3"
/>
<Tool
Name=
"VCCLCompilerTool"
/>
<Tool
Name=
"VCManagedResourceCompilerTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCLinkerTool"
BaseAddress=
"0x1e1F0000"
/>
<Tool
Name=
"VCALinkTool"
/>
<Tool
Name=
"VCManifestTool"
/>
<Tool
Name=
"VCXDCMakeTool"
/>
<Tool
Name=
"VCBscMakeTool"
/>
<Tool
Name=
"VCFxCopTool"
/>
<Tool
Name=
"VCAppVerifierTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name=
"Release|Win32"
ConfigurationType=
"2"
InheritedPropertySheets=
".\pyd.vsprops"
CharacterSet=
"0"
WholeProgramOptimization=
"1"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCCLCompilerTool"
/>
<Tool
Name=
"VCManagedResourceCompilerTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCLinkerTool"
BaseAddress=
"0x1e1F0000"
/>
<Tool
Name=
"VCALinkTool"
/>
<Tool
Name=
"VCManifestTool"
/>
<Tool
Name=
"VCXDCMakeTool"
/>
<Tool
Name=
"VCBscMakeTool"
/>
<Tool
Name=
"VCFxCopTool"
/>
<Tool
Name=
"VCAppVerifierTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name=
"Release|x64"
ConfigurationType=
"2"
InheritedPropertySheets=
".\pyd.vsprops;.\x64.vsprops"
CharacterSet=
"0"
WholeProgramOptimization=
"1"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCMIDLTool"
TargetEnvironment=
"3"
/>
<Tool
Name=
"VCCLCompilerTool"
/>
<Tool
Name=
"VCManagedResourceCompilerTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCLinkerTool"
BaseAddress=
"0x1e1F0000"
/>
<Tool
Name=
"VCALinkTool"
/>
<Tool
Name=
"VCManifestTool"
/>
<Tool
Name=
"VCXDCMakeTool"
/>
<Tool
Name=
"VCBscMakeTool"
/>
<Tool
Name=
"VCFxCopTool"
/>
<Tool
Name=
"VCAppVerifierTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name=
"PGInstrument|Win32"
ConfigurationType=
"2"
InheritedPropertySheets=
".\pyd.vsprops;.\pginstrument.vsprops"
CharacterSet=
"0"
WholeProgramOptimization=
"1"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCCLCompilerTool"
/>
<Tool
Name=
"VCManagedResourceCompilerTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCLinkerTool"
BaseAddress=
"0x1e1F0000"
/>
<Tool
Name=
"VCALinkTool"
/>
<Tool
Name=
"VCManifestTool"
/>
<Tool
Name=
"VCXDCMakeTool"
/>
<Tool
Name=
"VCBscMakeTool"
/>
<Tool
Name=
"VCFxCopTool"
/>
<Tool
Name=
"VCAppVerifierTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name=
"PGInstrument|x64"
ConfigurationType=
"2"
InheritedPropertySheets=
".\pyd.vsprops;.\x64.vsprops;.\pginstrument.vsprops"
CharacterSet=
"0"
WholeProgramOptimization=
"1"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCMIDLTool"
TargetEnvironment=
"3"
/>
<Tool
Name=
"VCCLCompilerTool"
/>
<Tool
Name=
"VCManagedResourceCompilerTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCLinkerTool"
BaseAddress=
"0x1e1F0000"
TargetMachine=
"17"
/>
<Tool
Name=
"VCALinkTool"
/>
<Tool
Name=
"VCManifestTool"
/>
<Tool
Name=
"VCXDCMakeTool"
/>
<Tool
Name=
"VCBscMakeTool"
/>
<Tool
Name=
"VCFxCopTool"
/>
<Tool
Name=
"VCAppVerifierTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name=
"PGUpdate|Win32"
ConfigurationType=
"2"
InheritedPropertySheets=
".\pyd.vsprops;.\pgupdate.vsprops"
CharacterSet=
"0"
WholeProgramOptimization=
"1"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCCLCompilerTool"
/>
<Tool
Name=
"VCManagedResourceCompilerTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCLinkerTool"
BaseAddress=
"0x1e1F0000"
/>
<Tool
Name=
"VCALinkTool"
/>
<Tool
Name=
"VCManifestTool"
/>
<Tool
Name=
"VCXDCMakeTool"
/>
<Tool
Name=
"VCBscMakeTool"
/>
<Tool
Name=
"VCFxCopTool"
/>
<Tool
Name=
"VCAppVerifierTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name=
"PGUpdate|x64"
ConfigurationType=
"2"
InheritedPropertySheets=
".\pyd.vsprops;.\x64.vsprops;.\pgupdate.vsprops"
CharacterSet=
"0"
WholeProgramOptimization=
"1"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCMIDLTool"
TargetEnvironment=
"3"
/>
<Tool
Name=
"VCCLCompilerTool"
/>
<Tool
Name=
"VCManagedResourceCompilerTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCLinkerTool"
BaseAddress=
"0x1e1F0000"
TargetMachine=
"17"
/>
<Tool
Name=
"VCALinkTool"
/>
<Tool
Name=
"VCManifestTool"
/>
<Tool
Name=
"VCXDCMakeTool"
/>
<Tool
Name=
"VCBscMakeTool"
/>
<Tool
Name=
"VCFxCopTool"
/>
<Tool
Name=
"VCAppVerifierTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name=
"Source Files"
>
<File
RelativePath=
"..\..\Modules\_testimportmultiple.c"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
PC/VS9.0/pcbuild.sln
View file @
7af53c36
...
...
@@ -87,6 +87,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcpr
{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testimportmultiple", "_testimportmultiple.vcproj", "{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}"
ProjectSection(ProjectDependencies) = postProject
{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_tkinter", "_tkinter.vcproj", "{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}"
ProjectSection(ProjectDependencies) = postProject
{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}
...
...
@@ -422,6 +427,22 @@ Global
{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|Win32.Build.0 = Release|Win32
{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|x64.ActiveCfg = Release|x64
{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|x64.Build.0 = Release|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|Win32.ActiveCfg = Debug|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|Win32.Build.0 = Debug|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|x64.ActiveCfg = Debug|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|x64.Build.0 = Debug|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|x64.Build.0 = PGInstrument|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|x64.Build.0 = PGUpdate|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|Win32.ActiveCfg = Release|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|Win32.Build.0 = Release|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|x64.ActiveCfg = Release|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|x64.Build.0 = Release|x64
{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|Win32.ActiveCfg = Debug|Win32
{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|Win32.Build.0 = Debug|Win32
{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|x64.ActiveCfg = Debug|x64
...
...
PCbuild/_testimportmultiple.vcxproj
0 → 100644
View file @
7af53c36
This diff is collapsed.
Click to expand it.
PCbuild/_testimportmultiple.vcxproj.filters
0 → 100644
View file @
7af53c36
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"4.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<ItemGroup>
<Filter
Include=
"Source Files"
>
<UniqueIdentifier>
{1ec38ad9-1abf-4b80-8628-ac43ccba324b}
</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile
Include=
"..\Modules\_testimportmultiple.c"
>
<Filter>
Source Files
</Filter>
</ClCompile>
</ItemGroup>
</Project>
PCbuild/pcbuild.sln
View file @
7af53c36
...
...
@@ -38,6 +38,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcxproj", "{C6
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcxproj", "{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testimportmultiple", "_testimportmultiple.vcxproj", "{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_tkinter", "_tkinter.vcxproj", "{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_bz2", "_bz2.vcxproj", "{73FCD2BD-F133-46B7-8EC1-144CD82A59D5}"
...
...
@@ -344,6 +346,22 @@ Global
{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|Win32.Build.0 = Release|Win32
{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|x64.ActiveCfg = Release|x64
{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}.Release|x64.Build.0 = Release|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|Win32.ActiveCfg = Debug|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|Win32.Build.0 = Debug|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|x64.ActiveCfg = Debug|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Debug|x64.Build.0 = Debug|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGInstrument|x64.Build.0 = PGInstrument|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.PGUpdate|x64.Build.0 = PGUpdate|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|Win32.ActiveCfg = Release|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|Win32.Build.0 = Release|Win32
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|x64.ActiveCfg = Release|x64
{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}.Release|x64.Build.0 = Release|x64
{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|Win32.ActiveCfg = Debug|Win32
{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|Win32.Build.0 = Debug|Win32
{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}.Debug|x64.ActiveCfg = Debug|x64
...
...
Python/import.c
View file @
7af53c36
...
...
@@ -452,12 +452,12 @@ PyImport_GetMagicTag(void)
/* Magic for extension modules (built-in as well as dynamically
loaded). To prevent initializing an extension module more than
once, we keep a static dictionary 'extensions' keyed by
module nam
e
(
for built-in modules) or by filename (for dynamically loaded
modules), containing these modules. A copy of the module's
dictionary is stored by calling _PyImport_FixupExtensionObject()
immediately after the module initialization function succeeds. A
copy can be retrieved from there by calling
once, we keep a static dictionary 'extensions' keyed by
the tupl
e
(
module name, module name) (for built-in modules) or by
(filename, module name) (for dynamically loaded modules), containing these
modules. A copy of the module's dictionary is stored by calling
_PyImport_FixupExtensionObject() immediately after the module initialization
function succeeds. A
copy can be retrieved from there by calling
_PyImport_FindExtensionObject().
Modules which do support multiple initialization set their m_size
...
...
@@ -470,7 +470,7 @@ int
_PyImport_FixupExtensionObject
(
PyObject
*
mod
,
PyObject
*
name
,
PyObject
*
filename
)
{
PyObject
*
modules
,
*
dict
;
PyObject
*
modules
,
*
dict
,
*
filename_name
;
struct
PyModuleDef
*
def
;
if
(
extensions
==
NULL
)
{
extensions
=
PyDict_New
();
...
...
@@ -508,7 +508,11 @@ _PyImport_FixupExtensionObject(PyObject *mod, PyObject *name,
if
(
def
->
m_base
.
m_copy
==
NULL
)
return
-
1
;
}
PyDict_SetItem
(
extensions
,
filename
,
(
PyObject
*
)
def
);
filename_name
=
PyTuple_Pack
(
2
,
filename
,
name
);
if
(
filename_name
==
NULL
)
return
-
1
;
if
(
PyDict_SetItem
(
extensions
,
filename_name
,
(
PyObject
*
)
def
)
<
0
)
return
-
1
;
return
0
;
}
...
...
@@ -528,11 +532,14 @@ _PyImport_FixupBuiltin(PyObject *mod, char *name)
PyObject
*
_PyImport_FindExtensionObject
(
PyObject
*
name
,
PyObject
*
filename
)
{
PyObject
*
mod
,
*
mdict
;
PyObject
*
mod
,
*
mdict
,
*
filename_name
;
PyModuleDef
*
def
;
if
(
extensions
==
NULL
)
return
NULL
;
def
=
(
PyModuleDef
*
)
PyDict_GetItem
(
extensions
,
filename
);
filename_name
=
PyTuple_Pack
(
2
,
filename
,
name
);
if
(
filename_name
==
NULL
)
return
NULL
;
def
=
(
PyModuleDef
*
)
PyDict_GetItem
(
extensions
,
filename_name
);
if
(
def
==
NULL
)
return
NULL
;
if
(
def
->
m_size
==
-
1
)
{
...
...
Tools/msi/msi.py
View file @
7af53c36
...
...
@@ -101,6 +101,7 @@ extensions = [
'_decimal.pyd'
,
'_testbuffer.pyd'
,
'_sha3.pyd'
,
'_testimportmultiple.pyd'
,
]
# Well-known component UUIDs
...
...
setup.py
View file @
7af53c36
...
...
@@ -594,6 +594,8 @@ class PyBuildExt(build_ext):
depends
=
[
'testcapi_long.h'
])
)
# Python PEP-3118 (buffer protocol) test module
exts
.
append
(
Extension
(
'_testbuffer'
,
[
'_testbuffer.c'
])
)
# Test loading multiple modules from one compiled file (http://bugs.python.org/issue16421)
exts
.
append
(
Extension
(
'_testimportmultiple'
,
[
'_testimportmultiple.c'
])
)
# profiler (_lsprof is for cProfile.py)
exts
.
append
(
Extension
(
'_lsprof'
,
[
'_lsprof.c'
,
'rotatingtree.c'
])
)
# static Unicode character database
...
...
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