From 0e79bc14babb282f8ba0dca2237209da80be6317 Mon Sep 17 00:00:00 2001 From: Tianyu Li Date: Wed, 14 Apr 2021 12:36:20 +0800 Subject: papi: fix ubuntu 1804 make test socket.close error make test failed on ubuntu 18.04 File "/vpp/src/vpp-api/python/vpp_papi/vpp_stats.py", line 135, in connect socket.close(mfd) AttributeError: module 'socket' has no attribute 'close' Due to ubuntu 18.04 using python3.6 and socket.close() is introduced since python3.7 Using os.close to replace socket.close as mfd is a memory fd Type: fix Signed-off-by: Tianyu Li Change-Id: I6d980fc87ae6c77bbed416879f9b2fcd0a0abe6a --- src/vpp-api/python/vpp_papi/vpp_stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/vpp-api/python/vpp_papi/vpp_stats.py b/src/vpp-api/python/vpp_papi/vpp_stats.py index 18f13e9c4c0..919df7e48b8 100755 --- a/src/vpp-api/python/vpp_papi/vpp_stats.py +++ b/src/vpp-api/python/vpp_papi/vpp_stats.py @@ -132,7 +132,7 @@ class VPPStats(): stat_result = os.fstat(mfd) self.statseg = mmap.mmap(mfd, stat_result.st_size, mmap.PROT_READ, mmap.MAP_SHARED) - socket.close(mfd) + os.close(mfd) self.size = stat_result.st_size if self.version != 2: -- cgit 1.2.3-korg