1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-25 11:42:12 +01:00

Merge pull request #482 from lethliel/python3_packagequery_module

[python3] magic is now a bytestring in python3
This commit is contained in:
Marco Strigl 2019-01-18 14:34:43 +01:00 committed by GitHub
commit f233066448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,18 +60,18 @@ class PackageQuery:
f.seek(0) f.seek(0)
extra_tags = () extra_tags = ()
pkgquery = None pkgquery = None
if magic[:4] == '\xed\xab\xee\xdb': if magic[:4] == b'\xed\xab\xee\xdb':
from . import rpmquery from . import rpmquery
pkgquery = rpmquery.RpmQuery(f) pkgquery = rpmquery.RpmQuery(f)
extra_tags = extra_rpmtags extra_tags = extra_rpmtags
elif magic == '!<arch>': elif magic == b'!<arch>':
from . import debquery from . import debquery
pkgquery = debquery.DebQuery(f) pkgquery = debquery.DebQuery(f)
extra_tags = extra_debtags extra_tags = extra_debtags
elif magic[:5] == '<?xml': elif magic[:5] == b'<?xml':
f.close() f.close()
return None return None
elif magic[:5] == '\375\067zXZ' or magic[:2] == '\037\213': elif magic[:5] == b'\375\067zXZ' or magic[:2] == b'\037\213':
from . import archquery from . import archquery
pkgquery = archquery.ArchQuery(f) pkgquery = archquery.ArchQuery(f)
else: else: