MCPcopy Index your code
hub / github.com/secdev/scapy / _git

Function _git

scapy/__init__.py:110–122  ·  view source on GitHub ↗
(cmd)

Source from the content-addressed store, hash-verified

108 raise ValueError('not in scapy git repo')
109
110 def _git(cmd):
111 # type: (str) -> str
112 process = subprocess.Popen(
113 cmd.split(),
114 cwd=_SCAPY_PKG_DIR,
115 stdout=subprocess.PIPE,
116 stderr=subprocess.PIPE
117 )
118 out, err = process.communicate()
119 if process.returncode == 0:
120 return out.decode().strip()
121 else:
122 raise subprocess.CalledProcessError(process.returncode, err)
123
124 tag = _git("git describe --tags --always --long")
125 if not tag.startswith("v"):

Callers 1

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected