(what: str)
| 17 | |
| 18 | |
| 19 | def get_config(what: str) -> str: |
| 20 | pg_config = "pg_config" |
| 21 | try: |
| 22 | out = sp.run([pg_config, f"--{what}"], stdout=sp.PIPE, check=True) |
| 23 | except Exception as e: |
| 24 | log.error(f"couldn't run {pg_config!r} --{what}: %s", e) |
| 25 | raise |
| 26 | else: |
| 27 | return out.stdout.strip().decode() |
| 28 | |
| 29 | |
| 30 | class psycopg_build_ext(build_ext): |