Skip to content

Add __version__ #312

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 3 commits into from
Jan 8, 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
2 changes: 1 addition & 1 deletion src/runtime/pythonengine.cs
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
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
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