File tree 2 files changed +17
-4
lines changed
2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,22 @@ async def test():
50
50
51
51
self .loop .run_until_complete (test ())
52
52
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
+
53
69
def test_process_cwd_1 (self ):
54
70
async def test ():
55
71
cmd = 'pwd'
Original file line number Diff line number Diff line change @@ -217,9 +217,6 @@ cdef class UVProcess(UVHandle):
217
217
218
218
char ** ret
219
219
220
- if UVLOOP_DEBUG:
221
- assert arr_len > 0
222
-
223
220
ret = < char ** > PyMem_RawMalloc((arr_len + 1 ) * sizeof(char * ))
224
221
if ret is NULL :
225
222
raise MemoryError ()
@@ -285,7 +282,7 @@ cdef class UVProcess(UVHandle):
285
282
self .uv_opt_args = self .__to_cstring_array(self .__args)
286
283
287
284
cdef _init_env(self , dict env):
288
- if env is not None and len (env) :
285
+ if env is not None :
289
286
self .__env = list ()
290
287
for key in env:
291
288
val = env[key]
You can’t perform that action at this time.
0 commit comments