File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,22 @@ async def test():
5050
5151 self .loop .run_until_complete (test ())
5252
53+ def test_process_env_2 (self ):
54+ async def test ():
55+ cmd = 'env'
56+ env = {} # empty environment
57+ proc = await asyncio .create_subprocess_exec (
58+ cmd ,
59+ env = env ,
60+ stdout = subprocess .PIPE ,
61+ stderr = subprocess .PIPE )
62+
63+ out , _ = await proc .communicate ()
64+ self .assertEqual (out , b'' )
65+ self .assertEqual (proc .returncode , 0 )
66+
67+ self .loop .run_until_complete (test ())
68+
5369 def test_process_cwd_1 (self ):
5470 async def test ():
5571 cmd = 'pwd'
Original file line number Diff line number Diff line change @@ -217,9 +217,6 @@ cdef class UVProcess(UVHandle):
217217
218218 char ** ret
219219
220- if UVLOOP_DEBUG:
221- assert arr_len > 0
222-
223220 ret = < char ** > PyMem_RawMalloc((arr_len + 1 ) * sizeof(char * ))
224221 if ret is NULL :
225222 raise MemoryError ()
@@ -285,7 +282,7 @@ cdef class UVProcess(UVHandle):
285282 self .uv_opt_args = self .__to_cstring_array(self .__args)
286283
287284 cdef _init_env(self , dict env):
288- if env is not None and len (env) :
285+ if env is not None :
289286 self .__env = list ()
290287 for key in env:
291288 val = env[key]
You can’t perform that action at this time.
0 commit comments