File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,9 +119,20 @@ class ProcessProxy(object):
119119 ptype: instance of ProcessType
120120 """
121121
122- def __init__ (self , process , ptype = None ):
123- self .process = process
124- self .ptype = ptype or ProcessType .from_process (process )
122+ _process : any
123+ _ptype : ProcessType
124+
125+ def __init__ (self , process , ptype : typing .Optional [ProcessType ] = None ):
126+ assert process is not None
127+ assert ptype is None or type (ptype ) == ProcessType # noqa: E721
128+ self ._process = process
129+
130+ if ptype is not None :
131+ self ._ptype = ptype
132+ else :
133+ self ._ptype = ProcessType .from_process (process )
134+ assert type (self ._ptype ) == ProcessType # noqa: E721
135+ return
125136
126137 def __getattr__ (self , name ):
127138 return getattr (self .process , name )
@@ -132,6 +143,16 @@ def __repr__(self):
132143 str (self .ptype ),
133144 repr (self .process ))
134145
146+ @property
147+ def process (self ) -> any :
148+ assert self ._process is not None
149+ return self ._process
150+
151+ @property
152+ def ptype (self ) -> ProcessType :
153+ assert type (self ._ptype ) == ProcessType # noqa: E721
154+ return self ._ptype
155+
135156
136157class PostgresNode (object ):
137158 # a max number of node start attempts
You can’t perform that action at this time.
0 commit comments