(self, pg_config_path)
| 561 | return config |
| 562 | |
| 563 | def _find_pg_config(self, pg_config_path): |
| 564 | if pg_config_path is None: |
| 565 | pg_install = ( |
| 566 | os.environ.get('PGINSTALLATION') |
| 567 | or os.environ.get('PGBIN') |
| 568 | ) |
| 569 | if pg_install: |
| 570 | pg_config_path = platform_exe( |
| 571 | os.path.join(pg_install, 'pg_config')) |
| 572 | else: |
| 573 | pathenv = os.environ.get('PATH').split(os.pathsep) |
| 574 | for path in pathenv: |
| 575 | pg_config_path = platform_exe( |
| 576 | os.path.join(path, 'pg_config')) |
| 577 | if os.path.exists(pg_config_path): |
| 578 | break |
| 579 | else: |
| 580 | pg_config_path = None |
| 581 | |
| 582 | if not pg_config_path: |
| 583 | raise ClusterError('could not find pg_config executable') |
| 584 | |
| 585 | if not os.path.isfile(pg_config_path): |
| 586 | raise ClusterError('{!r} is not an executable'.format( |
| 587 | pg_config_path)) |
| 588 | |
| 589 | return pg_config_path |
| 590 | |
| 591 | def _find_pg_binary(self, binary): |
| 592 | bpath = platform_exe(os.path.join(self._pg_bin_dir, binary)) |
no test coverage detected