=== modified file '.bzrignore'
--- .bzrignore 2011-12-01 02:00:33 +0000
+++ .bzrignore 2013-01-09 19:08:10 +0000
@@ -3,3 +3,8 @@
obj
bin
*.user
+*.pidb
+*.DS_Store
+monopythonnet.userprefs
+pythonnet.userprefs
+pythonnet/build
=== modified file 'pythonnet/Makefile'
--- pythonnet/Makefile 2011-03-19 10:38:43 +0000
+++ pythonnet/Makefile 2013-01-09 19:08:10 +0000
@@ -18,11 +18,11 @@
INSTALL=/usr/bin/install -m644
# Contributed by VIKAS DHIMAN - - Thanks, Vikas!
ARCH_FULL = $(shell uname -m)
-ifneq (, $(findstring 86, $(ARCH_FULL)))
- ARCH = x86
-else
+#ifneq (, $(findstring 86, $(ARCH_FULL)))
+# ARCH = x86
+#else
ARCH = x64
-endif
+#endif
ifeq ($(origin WINDIR), undefined)
RUNNER = mono
=== modified file 'pythonnet/Python.Runtime.dll.config'
--- pythonnet/Python.Runtime.dll.config 2011-07-04 01:07:15 +0000
+++ pythonnet/Python.Runtime.dll.config 2013-01-09 19:08:10 +0000
@@ -19,5 +19,16 @@
+
+
+
+
+
+
+
+
+
+
+
=== removed file 'pythonnet/monopythonnet.userprefs'
--- pythonnet/monopythonnet.userprefs 2007-07-27 17:32:55 +0000
+++ pythonnet/monopythonnet.userprefs 1970-01-01 00:00:00 +0000
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
=== modified file 'pythonnet/setup.py'
--- pythonnet/setup.py 2011-08-28 19:24:28 +0000
+++ pythonnet/setup.py 2013-01-09 19:08:10 +0000
@@ -25,7 +25,7 @@
XXX cmd = "export PKG_CONFIG_PATH=/opt/mono-2.8/lib/pkgconfig:... early 2011
"""
flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}
- cmd = "export PKG_CONFIG_PATH=/lib/pkgconfig; pkg-config --libs --cflags %s" % ' '.join(packages)
+ cmd = "pkg-config --libs --cflags %s" % ' '.join(packages)
popen = subprocess.Popen(cmd, shell=True, close_fds=True, stdout=subprocess.PIPE)
popen.wait()
if popen.returncode != 0:
@@ -57,5 +57,5 @@
setup(name="clr",
ext_modules = extensions,
- scripts = ["src/monoclr/clrpython%s" % VERSION],
- )
\ No newline at end of file
+ #scripts = ["src/monoclr/clrpython%s" % VERSION],
+ )
=== added file 'pythonnet/src/embed_tests/Embeddingtest.VisualState.xml'
--- pythonnet/src/embed_tests/Embeddingtest.VisualState.xml 1970-01-01 00:00:00 +0000
+++ pythonnet/src/embed_tests/Embeddingtest.VisualState.xml 2012-01-23 07:27:32 +0000
@@ -0,0 +1,21 @@
+
+
+ [0-1000]C:\Users\Barton\Documents\Visual Studio 2008\Projects\PySharp\trunk\pythonnet\src\embed_tests\Embeddingtest.nunit
+ [0-1003]Python.EmbeddingTest.PyImportTest
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
=== modified file 'pythonnet/src/embed_tests/Python.EmbeddingTest.csproj'
--- pythonnet/src/embed_tests/Python.EmbeddingTest.csproj 2010-10-07 08:16:52 +0000
+++ pythonnet/src/embed_tests/Python.EmbeddingTest.csproj 2012-01-23 07:27:32 +0000
@@ -28,6 +28,7 @@
false
false
true
+ v3.5
true
@@ -57,8 +58,11 @@
AnyCPU
-
+
+
+ 3.5
+
@@ -72,12 +76,6 @@
-
- {097B4AC0-74E9-4C58-BCF8-C69746EC8271}
- Python.Runtime
-
-
-
False
.NET Framework 2.0 %28x86%29
@@ -94,6 +92,12 @@
false
+
+
+ {097B4AC0-74E9-4C58-BCF8-C69746EC8271}
+ Python.Runtime
+
+
=== modified file 'pythonnet/src/embed_tests/pyimport.cs'
--- pythonnet/src/embed_tests/pyimport.cs 2010-10-07 08:16:52 +0000
+++ pythonnet/src/embed_tests/pyimport.cs 2012-01-23 07:27:32 +0000
@@ -24,7 +24,7 @@
* Append the tests directory to sys.path
* using reflection to circumvent the private modifires placed on most Runtime methods.
*/
- string s = @"..\..\..\tests";
+ string s = @"../../../tests";
Type RTClass = typeof(Runtime.Runtime);
=== modified file 'pythonnet/src/monoclr/Makefile'
--- pythonnet/src/monoclr/Makefile 2011-03-19 10:38:43 +0000
+++ pythonnet/src/monoclr/Makefile 2013-01-09 19:08:10 +0000
@@ -1,8 +1,9 @@
# Author: Christian Heimes
-PYTHON = python
+PYTHON ?= python
BASENAME = $(shell $(PYTHON) -c "import sys; print 'python%i.%i' % sys.version_info[:2]")
GCC = gcc
+#GCC = g++
ifeq ($(origin WINDIR), undefined)
DLL_OR_SO = "-shared"
@@ -11,16 +12,20 @@
endif
-PY_LIBS = $(shell $(PYTHON) -c "from distutils.sysconfig import get_config_vars; \
- print get_config_vars('BLDLIBRARY')[0]") #-lpython
-PY_CFLAGS = -I$(shell $(PYTHON) -c "from distutils.sysconfig import get_config_vars; \
- print get_config_vars('CFLAGS')[0] + ' -I' + get_config_vars('CONFINCLUDEPY')[0]")
-
-MONO_LIBS = $(shell pkg-config --libs mono) # Was --libs mono
-MONO_CFLAGS = $(shell pkg-config --cflags mono) # Was --cflags mono
-
-LIBS = $(MONO_LIBS) $(PY_LIBS)
-CFLAGS = $(MONO_CFLAGS) $(PY_CFLAGS)
+PY_LIBS = $(shell $(PYTHON) -c "from distutils.sysconfig import get_config_vars,get_python_lib;print '-L' + get_config_vars('LIBPL')[0] + get_config_vars('BLDLIBRARY')[0]")
+# print get_config_vars('BLDLIBRARY')[0] + ' -L' + get_config_vars('LIBPL')[0]") #
+# print '-L' + get_config_vars('LIBPL')[0]")
+PY_CFLAGS = $(shell $(PYTHON) -c "from distutils.sysconfig import get_config_vars,get_python_inc; \
+ print get_config_vars('CFLAGS')[0] + ' -I' + get_python_inc()") #
+
+MONO_LIBS = $(shell pkg-config --libs mono-2) # Was --libs mono
+MONO_CFLAGS = $(shell pkg-config --cflags mono-2) # Was --cflags mono
+
+GLIB_LIBS = $(shell pkg-config --libs glib-2.0)
+GLIB_CFLAGS = $(shell pkg-config --cflags glib-2.0)
+
+LIBS = $(MONO_LIBS) $(PY_LIBS) $(GLIB_LIBS)
+CFLAGS = $(MONO_CFLAGS) $(PY_CFLAGS) $(GLIB_CFLAGS)
all: clr$(BASENAME) $(BASENAME) clr.so
=== added file 'pythonnet/src/runtime/Makefile'
--- pythonnet/src/runtime/Makefile 1970-01-01 00:00:00 +0000
+++ pythonnet/src/runtime/Makefile 2013-01-09 19:08:10 +0000
@@ -0,0 +1,186 @@
+
+EXTRA_DIST = Makefile
+
+# Warning: This is an automatically generated file, do not edit!
+
+srcdir=.
+top_srcdir=../../../..
+
+include $(top_srcdir)/config.make
+
+ifeq ($(CONFIG),DEBUG)
+ASSEMBLY_COMPILER_COMMAND = gmcs
+ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -unsafe -warn:4 -optimize+ -debug "-define:TRACE;DEBUG;PYTHON27,UCS2"
+ASSEMBLY = bin/Debug/Python.Runtime.dll
+ASSEMBLY_MDB = $(ASSEMBLY).mdb
+COMPILE_TARGET = library
+PROJECT_REFERENCES =
+BUILD_DIR = bin/Debug/
+
+PYTHON_RUNTIME_DLL_MDB_SOURCE=bin/Debug/Python.Runtime.dll.mdb
+PYTHON_RUNTIME_DLL_MDB=$(BUILD_DIR)/Python.Runtime.dll.mdb
+PYTHON_RUNTIME_DLL_CONFIG_SOURCE=../../Python.Runtime.dll.config
+
+endif
+
+ifeq ($(CONFIG),RELEASE)
+ASSEMBLY_COMPILER_COMMAND = gmcs
+ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -unsafe -warn:4 -optimize+ "-define:TRACE;PYTHON27,UCS2"
+ASSEMBLY = bin/Release/Python.Runtime.dll
+ASSEMBLY_MDB =
+COMPILE_TARGET = library
+PROJECT_REFERENCES =
+BUILD_DIR = bin/Release/
+
+PYTHON_RUNTIME_DLL_MDB=
+PYTHON_RUNTIME_DLL_CONFIG_SOURCE=../../Python.Runtime.dll.config
+
+endif
+
+AL=al2
+SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll
+
+PROGRAMFILES = \
+ $(PYTHON_RUNTIME_DLL_MDB) \
+ $(PYTHON_RUNTIME_DLL_CONFIG)
+
+LINUX_PKGCONFIG = \
+ $(PYTHON_RUNTIME_PC)
+
+
+RESGEN=resgen2
+
+PYTHON_RUNTIME_DLL_CONFIG = $(BUILD_DIR)/Python.Runtime.dll.config
+PYTHON_RUNTIME_PC = $(BUILD_DIR)/python.runtime.pc
+
+FILES = \
+ arrayobject.cs \
+ assemblyinfo.cs \
+ assemblymanager.cs \
+ classbase.cs \
+ classmanager.cs \
+ classobject.cs \
+ clrobject.cs \
+ codegenerator.cs \
+ constructorbinder.cs \
+ constructorbinding.cs \
+ converter.cs \
+ debughelper.cs \
+ delegatemanager.cs \
+ delegateobject.cs \
+ eventbinding.cs \
+ eventobject.cs \
+ exceptions.cs \
+ extensiontype.cs \
+ fieldobject.cs \
+ generictype.cs \
+ genericutil.cs \
+ importhook.cs \
+ indexer.cs \
+ interfaceobject.cs \
+ interfaces.cs \
+ interop.cs \
+ iterator.cs \
+ managedtype.cs \
+ metatype.cs \
+ methodbinder.cs \
+ methodbinding.cs \
+ methodobject.cs \
+ methodwrapper.cs \
+ modulefunctionobject.cs \
+ moduleobject.cs \
+ modulepropertyobject.cs \
+ monosupport.cs \
+ nativecall.cs \
+ overload.cs \
+ propertyobject.cs \
+ pyansistring.cs \
+ pydict.cs \
+ pyfloat.cs \
+ pyint.cs \
+ pyiter.cs \
+ pylist.cs \
+ pylong.cs \
+ pynumber.cs \
+ pyobject.cs \
+ pysequence.cs \
+ pystring.cs \
+ pythonengine.cs \
+ pythonexception.cs \
+ pytuple.cs \
+ runtime.cs \
+ typemanager.cs \
+ typemethod.cs
+
+DATA_FILES =
+
+RESOURCES =
+
+EXTRAS = \
+ buildclrmodule.bat \
+ x64/clrmodule-platform.il \
+ x86/clrmodule-platform.il \
+ clrmodule.il \
+ ../../Python.Runtime.dll.config \
+ python.runtime.pc.in
+
+REFERENCES = \
+ System
+
+DLL_REFERENCES =
+
+CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG)
+
+#Targets
+all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) $(top_srcdir)/config.make
+
+include $(top_srcdir)/Makefile.include
+#include $(srcdir)/custom-hooks.make
+
+
+
+$(eval $(call emit-deploy-target,PYTHON_RUNTIME_DLL_CONFIG))
+$(eval $(call emit-deploy-wrapper,PYTHON_RUNTIME_PC,python.runtime.pc))
+
+
+$(eval $(call emit_resgen_targets))
+$(build_xamlg_list): %.xaml.g.cs: %.xaml
+ xamlg '$<'
+
+
+$(ASSEMBLY_MDB): $(ASSEMBLY)
+$(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(PROJECT_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list)
+ make pre-all-local-hook prefix=$(prefix)
+ mkdir -p $(shell dirname $(ASSEMBLY))
+ make $(CONFIG)_BeforeBuild
+ $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref)
+ make $(CONFIG)_AfterBuild
+ make post-all-local-hook prefix=$(prefix)
+
+install-local: $(ASSEMBLY) $(ASSEMBLY_MDB)
+ make pre-install-local-hook prefix=$(prefix)
+ make install-satellite-assemblies prefix=$(prefix)
+ mkdir -p '$(DESTDIR)$(libdir)/$(PACKAGE)'
+ $(call cp,$(ASSEMBLY),$(DESTDIR)$(libdir)/$(PACKAGE))
+ $(call cp,$(ASSEMBLY_MDB),$(DESTDIR)$(libdir)/$(PACKAGE))
+ $(call cp,$(PYTHON_RUNTIME_DLL_MDB),$(DESTDIR)$(libdir)/$(PACKAGE))
+ $(call cp,$(PYTHON_RUNTIME_DLL_CONFIG),$(DESTDIR)$(libdir)/$(PACKAGE))
+ mkdir -p '$(DESTDIR)$(libdir)/pkgconfig'
+ $(call cp,$(PYTHON_RUNTIME_PC),$(DESTDIR)$(libdir)/pkgconfig)
+ make post-install-local-hook prefix=$(prefix)
+
+uninstall-local: $(ASSEMBLY) $(ASSEMBLY_MDB)
+ make pre-uninstall-local-hook prefix=$(prefix)
+ make uninstall-satellite-assemblies prefix=$(prefix)
+ $(call rm,$(ASSEMBLY),$(DESTDIR)$(libdir)/$(PACKAGE))
+ $(call rm,$(ASSEMBLY_MDB),$(DESTDIR)$(libdir)/$(PACKAGE))
+ $(call rm,$(PYTHON_RUNTIME_DLL_MDB),$(DESTDIR)$(libdir)/$(PACKAGE))
+ $(call rm,$(PYTHON_RUNTIME_DLL_CONFIG),$(DESTDIR)$(libdir)/$(PACKAGE))
+ $(call rm,$(PYTHON_RUNTIME_PC),$(DESTDIR)$(libdir)/pkgconfig)
+ make post-uninstall-local-hook prefix=$(prefix)
+
+install: install-local
+uninstall: uninstall-local
+clean: clean-local
+
+include $(top_srcdir)/rules.make
=== modified file 'pythonnet/src/runtime/Python.Runtime.csproj'
--- pythonnet/src/runtime/Python.Runtime.csproj 2011-12-01 02:00:33 +0000
+++ pythonnet/src/runtime/Python.Runtime.csproj 2013-01-09 19:08:10 +0000
@@ -1,4 +1,5 @@
-
+
+
Debug
AnyCPU
@@ -28,78 +29,26 @@
false
false
true
+ 9.0.21022
+ 2.0
+ v2.0
- true
+ True
full
- true
- .\bin\Debug\
+ True
+ bin\Debug\
TRACE;DEBUG;PYTHON27,UCS2
- true
+ True
+ 4
pdbonly
- true
- .\bin\Release\
- TRACE;PYTHON26,UCS2
- true
-
-
- true
- bin\EmbeddingTest\
- TRACE;DEBUG;PYTHON26,UCS2
- true
- true
- full
- AnyCPU
-
-
- true
- bin\UnitTests\
- TRACE;DEBUG;PYTHON26,UCS2
- true
- true
- full
- AnyCPU
-
-
- true
- bin\x64\Debug\
- TRACE;DEBUG;PYTHON26,UCS2
- true
- true
- full
- x64
- 1607
-
-
- bin\x64\Release\
- TRACE;PYTHON26,UCS2
- true
- true
- pdbonly
- x64
- 1607
-
-
- true
- bin\x64\EmbeddingTest\
- TRACE;DEBUG;PYTHON26,UCS2
- true
- true
- full
- x64
- 1607
-
-
- true
- bin\x64\UnitTests\
- TRACE;DEBUG;PYTHON26,UCS2
- true
- true
- full
- x64
- 1607
+ True
+ bin\Release\
+ TRACE;PYTHON27,UCS2
+ True
+ 4
@@ -165,9 +114,9 @@
-
+
@@ -196,4 +145,10 @@
del "$(TargetDir)clr.pyd"
+
+
+ Python.Runtime.dll.config
+ PreserveNewest
+
+
\ No newline at end of file
=== modified file 'pythonnet/src/runtime/assemblymanager.cs'
--- pythonnet/src/runtime/assemblymanager.cs 2011-01-10 04:29:33 +0000
+++ pythonnet/src/runtime/assemblymanager.cs 2012-11-07 23:23:12 +0000
@@ -84,10 +84,13 @@
// Python runtime is initialized.
//===================================================================
- static void AssemblyLoadHandler(Object ob, AssemblyLoadEventArgs args){
- Assembly assembly = args.LoadedAssembly;
- assemblies.Add(assembly);
- ScanAssembly(assembly);
+ static void AssemblyLoadHandler (Object ob, AssemblyLoadEventArgs args)
+ {
+ Assembly assembly = args.LoadedAssembly;
+ if (!assembly.ReflectionOnly) {
+ assemblies.Add (assembly);
+ ScanAssembly (assembly);
+ }
}
=== removed file 'pythonnet/src/runtime/clrmodule.il'
--- pythonnet/src/runtime/clrmodule.il 2008-02-27 01:34:13 +0000
+++ pythonnet/src/runtime/clrmodule.il 1970-01-01 00:00:00 +0000
@@ -1,274 +0,0 @@
-// ==========================================================================
-// This software is subject to the provisions of the Zope Public License,
-// Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
-// THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-// WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-// FOR A PARTICULAR PURPOSE.
-// ==========================================================================
-
-//============================================================================
-// This file is a hand-maintained stub - it implements clr.dll, which can be
-// loaded by a standard CPython interpreter as an extension module. When it
-// is loaded, it bootstraps the managed runtime integration layer and defers
-// to it to do initialization and put the clr module into sys.modules, etc.
-
-// The "USE_PYTHON_RUNTIME_*" defines control what extra evidence is used
-// to help the CLR find the appropriate Python.Runtime assembly.
-
-// If defined, the "pythonRuntimeVersionString" variable must be set to
-// Python.Runtime's current version.
-#define USE_PYTHON_RUNTIME_VERSION
-
-// If defined, the "PythonRuntimePublicKeyTokenData" data array must be
-// set to Python.Runtime's public key token.
-//#define USE_PYTHON_RUNTIME_PUBLIC_KEY_TOKEN
-
-// If DEBUG_PRINT is defined, a few System.Console.WriteLine calls are made
-// to indicate what's going on during the load...
-//#define DEBUG_PRINT
-//============================================================================
-
-.assembly extern mscorlib
-{
- .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
- .ver 2:0:0:0
-}
-
-.assembly clr
-{
- .hash algorithm 0x00008004
- .ver 2:0:0:2
-}
-
-.module clr.dll
-.imagebase 0x00400000
-.subsystem 0x00000003
-.file alignment 512
-
-// This includes the platform-specific IL. The include search path
-// is set depending on whether we're compiling 32 or 64 bit.
-// This MUST come before any other .data directives!
-// Why, oh why, can't ilasm support command line #defines? :(
-#include "clrmodule-platform.il"
-
-#ifdef USE_PYTHON_RUNTIME_PUBLIC_KEY_TOKEN
-.data PythonRuntimePublicKeyTokenData = bytearray (64 e1 4e 84 5a bf 2e 60)
-#endif
-
-.class public auto ansi beforefieldinit clrModule extends [mscorlib]System.Object
-{
-#ifdef USE_PYTHON_RUNTIME_PUBLIC_KEY_TOKEN
- .field static assembly int64 PythonRuntimePublicKeyToken at PythonRuntimePublicKeyTokenData
-#endif
-
- .method public hidebysig specialname rtspecialname instance void
- .ctor() cil managed
- {
- .maxstack 1
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
- .method public hidebysig static void modopt([mscorlib]System.Runtime.CompilerServices.CallConvCdecl)
- initclr() cil managed
- {
- .vtentry 1:1
- .export [1] as initclr
-
- .maxstack 6
- .locals init (
- class [mscorlib]System.Reflection.Assembly pythonRuntime,
- class [mscorlib]System.Reflection.Assembly executingAssembly,
- class [mscorlib]System.Reflection.AssemblyName pythonRuntimeName,
- class [mscorlib]System.Type pythonEngineType,
- int8[] publicKeyToken,
- string assemblyDirectory,
- string pythonRuntimeVersionString,
- string pythonRuntimeDllPath)
-
- // pythonRuntime = null;
- ldnull
- stloc pythonRuntime
-
- .try
- {
-#ifdef DEBUG_PRINT
- ldstr "Attempting to load Python.Runtime using standard binding rules... "
- call void [mscorlib]System.Console::Write(string)
-#endif
-
- // Attempt to find and load Python.Runtime using standard assembly binding rules.
- // This roughly translates into looking in order:
- // - GAC
- // - ApplicationBase
- // - A PrivateBinPath under ApplicationBase
- // With an unsigned assembly, the GAC is skipped.
-
- // System.Reflection.AssemblyName pythonRuntimeName = new System.Reflection.AssemblyName();
- newobj instance void [mscorlib]System.Reflection.AssemblyName::.ctor()
- stloc pythonRuntimeName
-
- // pythonRuntimeName.Name = "Python.Runtime";
- ldloc pythonRuntimeName
- ldstr "Python.Runtime"
- callvirt instance void [mscorlib]System.Reflection.AssemblyName::set_Name(string)
-
-#ifdef USE_PYTHON_RUNTIME_VERSION
- // pythonRuntimeVersionString = "...";
- ldstr "2.0.0.2"
- stloc pythonRuntimeVersionString
-
- // pythonRuntimeName.Version = new Version(pythonRuntimeVersionString);
- ldloc pythonRuntimeName
- ldloc pythonRuntimeVersionString
- newobj instance void [mscorlib]System.Version::.ctor(string)
- callvirt instance void [mscorlib]System.Reflection.AssemblyName::set_Version(class [mscorlib]System.Version)
-#endif
-
-#ifdef USE_PYTHON_RUNTIME_PUBLIC_KEY_TOKEN
- // publicKeyToken = new byte[] { ... };
- ldc.i4.8
- newarr [mscorlib]System.Byte
- dup
- ldtoken field int64 clrModule::PythonRuntimePublicKeyToken
- call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, valuetype [mscorlib]System.RuntimeFieldHandle)
- stloc publicKeyToken
-
- // pythonRuntimeName.SetPublicKeyToken(publicKeyToken);
- ldloc pythonRuntimeName
- ldloc publicKeyToken
- callvirt instance void [mscorlib]System.Reflection.AssemblyName::SetPublicKeyToken(uint8[])
-#endif
-
- // pythonRuntimeName.CultureInfo = System.Globalization.CultureInfo.InvariantCulture;
- ldloc pythonRuntimeName
- call class [mscorlib]System.Globalization.CultureInfo [mscorlib]System.Globalization.CultureInfo::get_InvariantCulture()
- callvirt instance void [mscorlib]System.Reflection.AssemblyName::set_CultureInfo(class [mscorlib]System.Globalization.CultureInfo)
-
- // return System.Reflection.Assembly.Load(pythonRuntimeName);
- ldloc pythonRuntimeName
- call class [mscorlib]System.Reflection.Assembly [mscorlib]System.Reflection.Assembly::Load(class [mscorlib]System.Reflection.AssemblyName)
- stloc pythonRuntime
-
-#ifdef DEBUG_PRINT
- ldstr "Success!"
- call void [mscorlib]System.Console::WriteLine(string)
-#endif
- leave.s LOADED_PYTHON_RUNTIME
- }
- catch [mscorlib]System.Object
- {
-#ifdef DEBUG_PRINT
- ldstr "Failed."
- call void [mscorlib]System.Console::WriteLine(string)
-#endif
- leave.s EXIT_CLR_LOAD
- }
- EXIT_CLR_LOAD: nop
-
- .try
- {
- // If the above fails for any reason, we fallback to attempting to load "Python.Runtime.dll"
- // from the directory this assembly is running in. "This assembly" is probably "clr.pyd",
- // sitting somewhere in PYTHONPATH. This is using Assembly.LoadFrom, and inherits all the
- // caveats of that call. See MSDN docs for details.
- // Suzanne Cook's blog is also an excellent source of info on this:
- // http://blogs.msdn.com/suzcook/
- // http://blogs.msdn.com/suzcook/archive/2003/05/29/57143.aspx
- // http://blogs.msdn.com/suzcook/archive/2003/06/13/57180.aspx
- // executingAssembly = System.Reflection.Assembly.GetExecutingAssembly();
- call class [mscorlib]System.Reflection.Assembly [mscorlib]System.Reflection.Assembly::GetExecutingAssembly()
- stloc executingAssembly
-
- // assemblyDirectory = System.IO.Path.GetDirectoryName(executingAssembly.Location);
- ldloc executingAssembly
- callvirt instance string [mscorlib]System.Reflection.Assembly::get_Location()
- call string [mscorlib]System.IO.Path::GetDirectoryName(string)
- stloc assemblyDirectory
-
- // pythonRuntimeDllPath = System.IO.Path.Combine(assemblyDirectory, "Python.Runtime.dll");
- ldloc assemblyDirectory
- ldstr "Python.Runtime.dll"
- call string [mscorlib]System.IO.Path::Combine(string, string)
- stloc pythonRuntimeDllPath
-
-#ifdef DEBUG_PRINT
- ldstr "Attempting to load Python.Runtime from: '{0}'... "
- ldloc pythonRuntimeDllPath
- call void [mscorlib]System.Console::Write(string, object)
-#endif
-
- // pythonRuntime = System.Reflection.Assembly.LoadFrom(pythonRuntimeDllPath);
- ldloc pythonRuntimeDllPath
- call class [mscorlib]System.Reflection.Assembly [mscorlib]System.Reflection.Assembly::LoadFrom(string)
- stloc pythonRuntime
-
-#ifdef DEBUG_PRINT
- ldstr "Success!"
- call void [mscorlib]System.Console::WriteLine(string)
-#endif
- leave.s LOADED_PYTHON_RUNTIME
- }
- catch [mscorlib]System.Object
- {
-#ifdef DEBUG_PRINT
- ldstr "Failed."
- call void [mscorlib]System.Console::WriteLine(string)
-#endif
- leave.s EXIT_PYTHONPATH_LOAD
- }
- EXIT_PYTHONPATH_LOAD: nop
-
- // If we get here, we haven't loaded Python.Runtime, so bail.
-#ifdef DEBUG_PRINT
- ldstr "Could not load Python.Runtime, so sad."
- call void [mscorlib]System.Console::WriteLine(string)
-#endif
- ret;
-
- // Once here, we've successfully loaded SOME version of Python.Runtime
- // So now we get the PythonEngine and execute the InitExt method on it.
- LOADED_PYTHON_RUNTIME: nop
- .try
- {
-#ifdef DEBUG_PRINT
- ldstr "Running Python.Runtime.PythonEngine.InitExt()"
- call void [mscorlib]System.Console::WriteLine(string)
-#endif
- // pythonEngineType = pythonRuntime.GetType("Python.Runtime.PythonEngine");
- ldloc pythonRuntime
- ldstr "Python.Runtime.PythonEngine"
- callvirt instance class [mscorlib]System.Type [mscorlib]System.Reflection.Assembly::GetType(string)
- stloc pythonEngineType
-
- // pythonEngineType.InvokeMember("InitExt", System.Reflection.BindingFlags.InvokeMethod, null, null, null);
- ldloc pythonEngineType
- ldstr "InitExt"
- ldc.i4 0x100
- ldnull
- ldnull
- ldnull
- callvirt instance object [mscorlib]System.Type::InvokeMember( string,
- valuetype [mscorlib]System.Reflection.BindingFlags,
- class [mscorlib]System.Reflection.Binder,
- object,
- object[])
- pop
- leave.s EXIT_TRY_INVOKE
- }
- catch [mscorlib]System.Object
- {
-#ifdef DEBUG_PRINT
- ldstr "Error calling Python.Runtime.PythonEngine.InitExt()."
- call void [mscorlib]System.Console::WriteLine(string)
-#endif
- leave.s EXIT_TRY_INVOKE
- }
- EXIT_TRY_INVOKE: nop
-
- ret
- }
-}
-
=== modified file 'pythonnet/src/runtime/exceptions.cs'
--- pythonnet/src/runtime/exceptions.cs 2010-12-19 20:51:30 +0000
+++ pythonnet/src/runtime/exceptions.cs 2012-01-26 08:07:09 +0000
@@ -473,6 +473,7 @@
IntPtr etype = Runtime.PyObject_GetAttrString(op, "__class__");
Runtime.PyErr_SetObject(etype, op);
Runtime.Decref(etype);
+ Runtime.Decref(op);
}
///
=== modified file 'pythonnet/src/runtime/genericutil.cs'
--- pythonnet/src/runtime/genericutil.cs 2007-07-29 00:25:03 +0000
+++ pythonnet/src/runtime/genericutil.cs 2012-04-11 02:23:52 +0000
@@ -36,9 +36,13 @@
// Register a generic type that appears in a given namespace.
//====================================================================
- internal static void Register(Type t) {
- Dictionary> nsmap = null;
- mapping.TryGetValue(t.Namespace, out nsmap);
+ internal static void Register(Type t) {
+ if (t.Namespace == null)
+ {
+ return;
+ }
+ Dictionary> nsmap = null;
+ mapping.TryGetValue(t.Namespace, out nsmap);
if (nsmap == null) {
nsmap = new Dictionary>();
mapping[t.Namespace] = nsmap;
=== added file 'pythonnet/src/runtime/python.runtime.pc'
--- pythonnet/src/runtime/python.runtime.pc 1970-01-01 00:00:00 +0000
+++ pythonnet/src/runtime/python.runtime.pc 2013-01-06 22:29:45 +0000
@@ -0,0 +1,6 @@
+Name: Python.Runtime
+Description: Python.Runtime
+Version: 0.1
+
+Requires:
+Libs: -r:/usr/local/fie/fie/0.2.0/debug/lib/fiecombootstrap/Python.Runtime.dll
=== added file 'pythonnet/src/runtime/python.runtime.pc.in'
--- pythonnet/src/runtime/python.runtime.pc.in 1970-01-01 00:00:00 +0000
+++ pythonnet/src/runtime/python.runtime.pc.in 2012-10-26 02:56:34 +0000
@@ -0,0 +1,6 @@
+Name: Python.Runtime
+Description: Python.Runtime
+Version: 0.1
+
+Requires:
+Libs: -r:@expanded_libdir@/@PACKAGE@/Python.Runtime.dll
=== modified file 'pythonnet/src/runtime/pythonexception.cs'
--- pythonnet/src/runtime/pythonexception.cs 2007-08-12 22:20:52 +0000
+++ pythonnet/src/runtime/pythonexception.cs 2012-01-26 08:07:09 +0000
@@ -27,11 +27,11 @@
public PythonException() : base()
{
+ IntPtr gs = PythonEngine.AcquireLock();
Runtime.PyErr_Fetch(ref _pyType, ref _pyValue, ref _pyTB);
Runtime.Incref(_pyType);
Runtime.Incref(_pyValue);
Runtime.Incref(_pyTB);
- IntPtr gs = PythonEngine.AcquireLock();
if ((_pyType != IntPtr.Zero) && (_pyValue != IntPtr.Zero))
{
string type = new PyObject(_pyType).GetAttr("__name__").ToString();
=== modified file 'pythonnet/src/testing/Python.Test.csproj'
--- pythonnet/src/testing/Python.Test.csproj 2011-12-01 02:00:33 +0000
+++ pythonnet/src/testing/Python.Test.csproj 2012-04-09 00:35:58 +0000
@@ -1,4 +1,5 @@
-
+
+
Debug
AnyCPU
@@ -13,19 +14,24 @@
2.0
+ 9.0.21022
+ 2.0
+ v2.0
true
full
false
- .\bin\Debug\
+ bin\Debug\
DEBUG;TRACE
+ 4
pdbonly
true
- .\bin\Release\
+ bin\Release\
TRACE
+ 4
true
@@ -33,6 +39,8 @@
DEBUG;TRACE
full
AnyCPU
+ 4
+ false
true
@@ -40,6 +48,8 @@
DEBUG;TRACE
full
AnyCPU
+ 4
+ false