FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add __version__ by vmuriart · Pull Request #312 · pythonnet/pythonnet · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cs  (1) .py  (2) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion src/runtime/pythonengine.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public static void Initialize()
Runtime.PyDict_SetItemString(clr_dict, "_extras", module);
foreach (PyObject key in locals.Keys())
{
if (!key.ToString().StartsWith("_"))
if (!key.ToString().StartsWith("_") || key.ToString().Equals("__version__"))
{
PyObject value = locals[key];
Runtime.PyDict_SetItem(clr_dict, key.Handle, value.Handle);
Expand Down
4 changes: 3 additions & 1 deletion src/runtime/resources/clr.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""
"""
Code in this module gets loaded into the main clr module.
"""

__version__ = "2.2.0"


class clrproperty(object):
"""
Expand Down
4 changes: 4 additions & 0 deletions src/tests/test_module.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def test000importClr(self):
import clr
self.assertTrue(self.isCLRRootModule(clr))

def testVersionClr(self):
import clr
self.assertTrue(clr.__version__ >= "2.2.0")

def testPreloadVar(self):
import clr
self.assertTrue(clr.getPreload() is False, clr.getPreload())
Expand Down

Back | FazBrowse Home | New Git URL