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 <tianyu.li@arm.com>
Change-Id: I6d980fc87ae6c77bbed416879f9b2fcd0a0abe6a
diff --git a/src/vpp-api/python/vpp_papi/vpp_stats.py b/src/vpp-api/python/vpp_papi/vpp_stats.py
index 18f13e9..919df7e 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 @@
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: