| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -85,6 +85,7 @@ internal static Version PyVersion | |||
| 85 | 85 | } | |
| 86 | 86 | } | |
| 87 | 87 | ||
| 88 | + const string RunSysPropName = "__pythonnet_run__"; | ||
| 88 | 89 | static int run = 0; | |
| 89 | 90 | ||
| 90 | 91 | internal static int GetRun() | |
@@ -142,7 +143,7 @@ internal static void Initialize(bool initSigs = false, ShutdownMode mode = Shutd | |||
| 142 | 143 | PyGILState_Ensure(); | |
| 143 | 144 | } | |
| 144 | 145 | ||
| 145 | - BorrowedReference pyRun = PySys_GetObject("__pynet_run__"); | ||
| 146 | + BorrowedReference pyRun = PySys_GetObject(RunSysPropName); | ||
| 146 | 147 | if (pyRun != null) | |
| 147 | 148 | { | |
| 148 | 149 | run = checked((int)PyLong_AsSignedSize_t(pyRun)); | |
@@ -201,7 +202,7 @@ static void NewRun() | |||
| 201 | 202 | { | |
| 202 | 203 | run++; | |
| 203 | 204 | using var pyRun = PyLong_FromLongLong(run); | |
| 204 | - PySys_SetObject("__pynet_run__", pyRun); | ||
| 205 | + PySys_SetObject(RunSysPropName, pyRun); | ||
| 205 | 206 | } | |
| 206 | 207 | ||
| 207 | 208 | private static void InitPyMembers() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments