@@ -469,16 +469,24 @@ public static void Exec(string code, IntPtr? globals = null, IntPtr? locals = nu
469
469
470
470
471
471
/// <summary>
472
- /// RunString Method
472
+ /// RunString Method. Function has been deprecated and will be removed.
473
+ /// Use Exec/Eval/RunSimpleString instead.
474
+ /// </summary>
475
+ [ Obsolete ( "RunString is deprecated and will be removed. Use Exec/Eval/RunSimpleString instead." ) ]
476
+ public static PyObject RunString ( string code , IntPtr ? globals = null , IntPtr ? locals = null )
477
+ {
478
+ return RunString ( code , globals , locals , RunFlagType . File ) ;
479
+ }
480
+
481
+ /// <summary>
482
+ /// Internal RunString Method.
473
483
/// </summary>
474
484
/// <remarks>
475
485
/// Run a string containing Python code. Returns the result of
476
486
/// executing the code string as a PyObject instance, or null if
477
487
/// an exception was raised.
478
488
/// </remarks>
479
- public static PyObject RunString (
480
- string code , IntPtr ? globals = null , IntPtr ? locals = null , RunFlagType _flag = RunFlagType . File
481
- )
489
+ internal static PyObject RunString ( string code , IntPtr ? globals , IntPtr ? locals , RunFlagType flag )
482
490
{
483
491
var borrowedGlobals = true ;
484
492
if ( globals == null )
@@ -502,12 +510,10 @@ public static PyObject RunString(
502
510
borrowedLocals = false ;
503
511
}
504
512
505
- var flag = ( IntPtr ) _flag ;
506
-
507
513
try
508
514
{
509
515
IntPtr result = Runtime . PyRun_String (
510
- code , flag , globals . Value , locals . Value
516
+ code , ( IntPtr ) flag , globals . Value , locals . Value
511
517
) ;
512
518
513
519
Runtime . CheckExceptionOccurred ( ) ;
0 commit comments