(bin_dir)
| 50 | |
| 51 | |
| 52 | def get_binary_version(bin_dir): |
| 53 | postgres = os.path.join(bin_dir or '', 'postgres') |
| 54 | version = subprocess.check_output([postgres, '--version']).decode() |
| 55 | version = re.match(r'^[^\s]+ [^\s]+ (\d+)(\.(\d+))?', version) |
| 56 | return '.'.join([version.group(1), version.group(3)]) if int(version.group(1)) < 10 else version.group(1) |
| 57 | |
| 58 | |
| 59 | def get_bin_dir(version): |
no outgoing calls
no test coverage detected