fix params on PC and when reading path from env (#2340)

* fix params when reading path from env

* fix pc
old-commit-hash: 707a670f42dc87c322c6d27eb147ba260b149e23
This commit is contained in:
Adeeb Shihadeh
2020-10-14 13:45:24 -07:00
committed by GitHub
parent 7fbba16989
commit 31ea16e7fa
2 changed files with 16 additions and 14 deletions
+9 -6
View File
@@ -1,10 +1,13 @@
# distutils: langauge = c++
import threading
import os
# cython: language_level = 3
from libcpp cimport bool
from libcpp.string cimport string
from params_pxd cimport Params as c_Params
import os
import threading
from common.basedir import PARAMS
cdef enum TxType:
PERSISTENT = 1
CLEAR_ON_MANAGER_START = 2
@@ -81,11 +84,11 @@ class UnknownKeyName(Exception):
cdef class Params:
cdef c_Params* p
def __cinit__(self, d=None, persistent_params=False):
if d is not None:
self.p = new c_Params(<string>d.encode())
def __cinit__(self, d=PARAMS, bool persistent_params=False):
if persistent_params:
self.p = new c_Params(True)
else:
self.p = new c_Params(<bool>persistent_params)
self.p = new c_Params(<string>d.encode())
def __dealloc__(self):
del self.p