(cmd)
| 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"): |
no test coverage detected