test: Replace map by list comprehension

Submitted by Harshavardhan Unnibhavi on April 7, 2019, 8:59 a.m.

Details

Message ID 20190407085953.9323-1-hvubfoss@gmail.com
State Accepted
Series "test: Replace map by list comprehension"
Commit c5a2eed24cceda0ce2328668a146877c7f148e89
Headers show

Commit Message

Harshavardhan Unnibhavi April 7, 2019, 8:59 a.m.
Fixes #331.

https://github.com/checkpoint-restore/criu/issues/331
Signed-off-by: Harshavardhan Unnibhavi <hvubfoss@gmail.com>
---
 test/exhaustive/unix.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/test/exhaustive/unix.py b/test/exhaustive/unix.py
index 6b1ed85d..41053bd0 100755
--- a/test/exhaustive/unix.py
+++ b/test/exhaustive/unix.py
@@ -415,7 +415,7 @@  class state:
 	# one in which. At the same time really different states
 	# shouldn't map to the same string.
 	def describe(self):
-		sks = map(lambda x: x.describe(self), self.sockets)
+		sks = [x.describe(self) for x in self.sockets]
 		sks = sorted(sks)
 		return '_'.join(sks)
 

Comments

Andrei Vagin May 3, 2019, 7:09 a.m.
Applied, thanks!

On Sun, Apr 07, 2019 at 02:29:53PM +0530, Harshavardhan Unnibhavi wrote:
> Fixes #331.
> 
> https://github.com/checkpoint-restore/criu/issues/331
> Signed-off-by: Harshavardhan Unnibhavi <hvubfoss@gmail.com>
> ---
>  test/exhaustive/unix.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/test/exhaustive/unix.py b/test/exhaustive/unix.py
> index 6b1ed85d..41053bd0 100755
> --- a/test/exhaustive/unix.py
> +++ b/test/exhaustive/unix.py
> @@ -415,7 +415,7 @@ class state:
>  	# one in which. At the same time really different states
>  	# shouldn't map to the same string.
>  	def describe(self):
> -		sks = map(lambda x: x.describe(self), self.sockets)
> +		sks = [x.describe(self) for x in self.sockets]
>  		sks = sorted(sks)
>  		return '_'.join(sks)
>  
> -- 
> 2.17.1
> 
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu