Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Binary substitution of Python.Runtime.dll becomes safe. #456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/embed_tests/TestPythonEngineProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void SetProgramName()
[Test]
public void SetPythonPath()
{
if (Runtime.Runtime.pyversion == "2.7")
if (Runtime.Runtime._pyversion == "2.7")
{
// Assert.Skip outputs as a warning (ie. pending to fix)
Assert.Pass();
Expand All @@ -166,7 +166,7 @@ public void SetPythonPath()
[Test]
public void SetPythonPathExceptionOn27()
{
if (Runtime.Runtime.pyversion != "2.7")
if (Runtime.Runtime._pyversion != "2.7")
{
Assert.Pass();
}
Expand Down
6 changes: 3 additions & 3 deletions src/runtime/CustomMarshaler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ public static int GetUnicodeByteLength(IntPtr p)
var len = 0;
while (true)
{
int c = Runtime.UCS == 2
int c = Runtime._UCS == 2
? Marshal.ReadInt16(p, len * 2)
: Marshal.ReadInt32(p, len * 4);

if (c == 0)
{
return len * Runtime.UCS;
return len * Runtime._UCS;
}
checked
{
Expand Down Expand Up @@ -163,7 +163,7 @@ public override IntPtr MarshalManagedToNative(object managedObj)
}

int totalStrLength = argv.Sum(arg => arg.Length + 1);
int memSize = argv.Length * IntPtr.Size + totalStrLength * Runtime.UCS;
int memSize = argv.Length * IntPtr.Size + totalStrLength * Runtime._UCS;

IntPtr mem = Marshal.AllocHGlobal(memSize);
try
Expand Down
6 changes: 4 additions & 2 deletions src/runtime/Python.Runtime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
<SignAssembly>false</SignAssembly>
<AssemblyOriginatorKeyFile>..\pythonnet.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x86'">
<!--We can relax binding to platform because code references no any platform dependent assemblies-->
<!--This will allows to use any build of this assebly as a compile ref assebly-->
<!--<PropertyGroup Condition=" '$(Platform)' == 'x86'">
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x64'">
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
</PropertyGroup>-->
<PropertyGroup Condition=" '$(Configuration)' == 'ReleaseMono'">
<DefineConstants Condition="'$(DefineConstants)' == ''">PYTHON2;PYTHON27;UCS4</DefineConstants>
<Optimize>true</Optimize>
Expand Down
Loading