MCPcopy Index your code
hub / github.com/MagicStack/asyncpg / _find_pg_config

Method _find_pg_config

asyncpg/cluster.py:563–589  ·  view source on GitHub ↗
(self, pg_config_path)

Source from the content-addressed store, hash-verified

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))

Callers 1

_init_envMethod · 0.95

Calls 3

platform_exeFunction · 0.85
ClusterErrorClass · 0.85
getMethod · 0.80

Tested by

no test coverage detected