Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Python.Runtime causes casting errors when setting global vars #420

Copy link
Copy link
@den-run-ai

Description

@den-run-ai
Issue body actions

Environment

  • Pythonnet version: 2.2.2, strongly signed post-installation
  • Python version: 2.7, 32bit
  • Operating System: Windows 7, 64bit

Details

  • Describe what you were trying to get done.
GLOB=1
def test_glob():
	return GLOB
Microsoft (R) Roslyn C# Compiler version 1.2.0.60425
Loading context from 'CSharpInteractive.rsp'.
Type "#help" for more information.
> #r "C:\Python\Python27_32b\Lib\site-packages\Python.Runtime.dll"
> using Python.Runtime;
> dynamic test_glob; using (Py.GIL()) { test_glob = Py.Import("test_glob"); }
> test_glob.GLOB
[1]
> test_glob.GLOB=1
Unable to cast object of type 'System.Int32' to type 'Python.Runtime.PyObject'.
  + Python.Runtime.PyObject.TrySetMember(System.Dynamic.SetMemberBinder, object)
  + System.Dynamic.UpdateDelegates.UpdateAndExecute2<T0, T1, TRet>(System.Runtime.CompilerServices.CallSite, T0, T1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.