File tree 2 files changed +4
-11
lines changed
2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public void TestCompileExpression()
53
53
{
54
54
ps . SetVariable ( "bb" , 100 ) ; //declare a global variable
55
55
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 ) ;
57
57
var result = ps . Execute < int > ( script ) ;
58
58
Assert . AreEqual ( result , 113 ) ;
59
59
}
@@ -68,7 +68,7 @@ public void TestCompileStatements()
68
68
{
69
69
ps . SetVariable ( "bb" , 100 ) ; //declare a global variable
70
70
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 ) ;
72
72
ps . Execute ( script ) ;
73
73
int result = ps . GetVariable < int > ( "aa" ) ;
74
74
Assert . AreEqual ( result , 113 ) ;
Original file line number Diff line number Diff line change @@ -495,14 +495,7 @@ public class PySessionDisposedException: Exception
495
495
{
496
496
497
497
}
498
-
499
- public enum CompileMode
500
- {
501
- Single = 256 ,
502
- File = 257 ,
503
- Eval = 258
504
- }
505
-
498
+
506
499
public class PyScope : IDisposable
507
500
{
508
501
public class GILState : IDisposable
@@ -695,7 +688,7 @@ public T Execute<T>(PyObject script)
695
688
/// <remarks>
696
689
/// Compile Python expression/statements into ast.
697
690
/// </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 )
699
692
{
700
693
IntPtr flag = ( IntPtr ) mode ;
701
694
IntPtr ptr = Runtime . Py_CompileString ( code , filename , flag ) ;
You can’t perform that action at this time.
0 commit comments