diff --git a/dh_python2 b/dh_python2 index d5e803df31d21b736512742f5f6ccf0b6542d30d..9378d9ed9f9313ce7dde41a2e145ffbd0663a74f 100755 --- a/dh_python2 +++ b/dh_python2 @@ -541,7 +541,6 @@ def main(): dependencies = Dependencies(package) dependencies.parse(stats, options) - dependencies.export_to(dh) if stats['public_vers']: dh.addsubstvar(package, 'python:Versions', \ @@ -579,15 +578,20 @@ def main(): else: # try shebang or default Python version ver = (list(v for i, v in details.get('shebangs', []) if v) or [None])[0] or DEFAULT + dependencies.depend("python%d.%d" % ver) args += " -V %s" % vrepr(ver) else: - args += " -V %s" % vrepr(ext_for.pop()) + version = ext_for.pop() + args += " -V %s" % vrepr(version) + dependencies.depend("python%d.%d" % version) for pattern in options.regexpr or []: args += " -X '%s'" % pattern.replace("'", r"\'") dh.autoscript(package, 'postinst', 'postinst-pycompile', args) + dependencies.export_to(dh) + pydist_file = join('debian', "%s.pydist" % package) if exists(pydist_file): if not validate_pydist(pydist_file, True):