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

Skip to content

Commit f9d047e

Browse files
committed
rebased
1 parent 0125d29 commit f9d047e

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
@@ -495,14 +495,7 @@ public class PySessionDisposedException: Exception
495495
{
496496

497497
}
498-
499-
public enum CompileMode
500-
{
501-
Single = 256,
502-
File = 257,
503-
Eval = 258
504-
}
505-
498+
506499
public class PyScope : IDisposable
507500
{
508501
public class GILState : IDisposable
@@ -695,7 +688,7 @@ public T Execute<T>(PyObject script)
695688
/// <remarks>
696689
/// Compile Python expression/statements into ast.
697690
/// </remarks>
698-
public PyObject Compile(string code, string filename = "", CompileMode mode = CompileMode.File)
691+
public PyObject Compile(string code, string filename = "", RunFlagType mode = RunFlagType.File)
699692
{
700693
IntPtr flag = (IntPtr)mode;
701694
IntPtr ptr = Runtime.Py_CompileString(code, filename, flag);

0 commit comments

Comments
 (0)