diff options
author | Tianyu Li <tianyu.li@arm.com> | 2021-04-14 12:36:20 +0800 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2021-04-15 16:35:45 +0000 |
commit | 0e79bc14babb282f8ba0dca2237209da80be6317 (patch) | |
tree | ca6d212702e249b3d40c47a822d186f366493881 /src | |
parent | 7f57f50d0c516a0e54829b0e99aeb1908862595d (diff) |
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
Diffstat (limited to 'src')
-rwxr-xr-x | src/vpp-api/python/vpp_papi/vpp_stats.py | 2 |
1 files changed, 1 insertions, 1 deletions
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: |