Skip to content

Commit 1bd2d0f

Browse files
committed
Merge pull request #35 from mariospr/OpenprintingQueryArchitecture
2 parents 4f9d92a + f5f9be4 commit 1bd2d0f

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

cupshelpers/openprinting.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,19 @@ def parse_result (status, data, result):
378378
if isinstance(model, Device):
379379
model = model.id
380380

381+
architecture = platform.machine()
382+
383+
# On Intel, we could be running a 32bit user space with a 64bit kernel, in
384+
# which case platform.machine() will return x86_64, leading to downloading
385+
# the wrong printer driver, so we make sure we ask for i386 in that case.
386+
if architecture == 'x86_64' and platform.architecture()[0] == '32bit':
387+
architecture = 'i386'
388+
381389
params = { 'type': 'drivers',
382390
'moreinfo': '1',
383391
'showprinterid': '1',
384392
'onlynewestdriverpackages': '1',
385-
'architectures': platform.machine(),
393+
'architectures': architecture,
386394
'noobsoletes': '1',
387395
'onlyfree': str (self.onlyfree),
388396
'onlymanufacturer': str (self.onlymanufacturer),

0 commit comments

Comments
 (0)