Browse Source

Avoids calling ffi.dlopen(None) on Windows

ffi.dlopen(None) cannot work on Windows and it is a
known issue [1]. This patch avoids this call on Windows
hosts.

[1] https://bugs.python.org/issue23606

Change-Id: I44436146cdc402087f33f4b99054176134ec5b81
Closes-Bug: #1788025
Claudiu Belu 8 months ago
parent
commit
b1f50df3b1
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      oslo_privsep/capabilities.py

+ 1
- 1
oslo_privsep/capabilities.py View File

@@ -108,13 +108,13 @@ int prctl (int __option, ...);
108 108
 '''
109 109
 
110 110
 ffi = cffi.FFI()
111
-crt = ffi.dlopen(None)
112 111
 ffi.cdef(CDEF)
113 112
 
114 113
 
115 114
 if platform.system() == 'Linux':
116 115
     # mock.patching crt.* directly seems to upset cffi.  Use an
117 116
     # indirection point here for easier testing.
117
+    crt = ffi.dlopen(None)
118 118
     _prctl = crt.prctl
119 119
     _capget = crt.capget
120 120
     _capset = crt.capset

Loading…
Cancel
Save