MCPcopy Create free account
hub / github.com/iovisor/bcc / NSPopenWithCheck

Class NSPopenWithCheck

tests/python/utils.py:70–81  ·  view source on GitHub ↗

A wrapper for NSPopen that additionally checks if the program to be executed is available from the system path or not. If found, it proceeds with the usual NSPopen() call. Otherwise, it raises an exception.

Source from the content-addressed store, hash-verified

68 return decorator
69
70class NSPopenWithCheck(NSPopen):
71 """
72 A wrapper for NSPopen that additionally checks if the program
73 to be executed is available from the system path or not.
74 If found, it proceeds with the usual NSPopen() call.
75 Otherwise, it raises an exception.
76 """
77
78 def __init__(self, nsname, *argv, **kwarg):
79 name = list(argv)[0][0]
80 has_executable(name)
81 super(NSPopenWithCheck, self).__init__(nsname, *argv, **kwarg)
82
83KERNEL_VERSION_PATTERN = r"v?(?P<major>[0-9]+)\.(?P<minor>[0-9]+).*"
84

Callers 2

test_brb2Method · 0.90
test_brbMethod · 0.90

Calls

no outgoing calls

Tested by 2

test_brb2Method · 0.72
test_brbMethod · 0.72