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

Skip to content

Commit 49af0cd

Browse files
yagwebvmuriart
authored andcommitted
rebased
1 parent 30fdf4c commit 49af0cd

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

src/embed_tests/pyscope.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void TestCompileExpression()
5353
{
5454
ps.SetVariable("bb", 100); //declare a global variable
5555
ps.SetVariable("cc", 10); //declare a local variable
56-
var script = ps.Compile("bb+cc+3", "", CompileMode.Eval);
56+
var script = ps.Compile("bb+cc+3", "", RunFlagType.Eval);
5757
var result = ps.Execute<int>(script);
5858
Assert.AreEqual(result, 113);
5959
}
@@ -68,7 +68,7 @@ public void TestCompileStatements()
6868
{
6969
ps.SetVariable("bb", 100); //declare a global variable
7070
ps.SetVariable("cc", 10); //declare a local variable
71-
var script = ps.Compile("aa=bb+cc+3", "", CompileMode.File);
71+
var script = ps.Compile("aa=bb+cc+3", "", RunFlagType.File);
7272
ps.Execute(script);
7373
int result = ps.GetVariable<int>("aa");
7474
Assert.AreEqual(result, 113);

src/runtime/pythonengine.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -502,14 +502,7 @@ public class PySessionDisposedException: Exception
502502
{
503503

504504
}
505-
506-
public enum CompileMode
507-
{
508-
Single = 256,
509-
File = 257,
510-
Eval = 258
511-
}
512-
505+
513506
public class PyScope : IDisposable
514507
{
515508
public class GILState : IDisposable
@@ -702,7 +695,7 @@ public T Execute<T>(PyObject script)
702695
/// <remarks>
703696
/// Compile Python expression/statements into ast.
704697
/// </remarks>
705-
public PyObject Compile(string code, string filename = "", CompileMode mode = CompileMode.File)
698+
public PyObject Compile(string code, string filename = "", RunFlagType mode = RunFlagType.File)
706699
{
707700
IntPtr flag = (IntPtr)mode;
708701
IntPtr ptr = Runtime.Py_CompileString(code, filename, flag);

0 commit comments

Comments
 (0)