From 700d109af680ca7fc22a3a218f8ceeee65ddf583 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 15 May 2016 14:11:34 +0200 Subject: [PATCH] port update-motd.d/40-updates to python3 jessie and trusty install python3-apt by default, xenial no longer installes python-apt. --- scripts/update-motd.d/40-updates | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/update-motd.d/40-updates b/scripts/update-motd.d/40-updates index 2e3e4b39e0..b9e34ad298 100644 --- a/scripts/update-motd.d/40-updates +++ b/scripts/update-motd.d/40-updates @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # # 40-updates - create the list of packages for update with caching # Copyright (c) 2015 Igor Pecovnik @@ -59,7 +59,7 @@ def refreshdata (): # open the apt cache try: cache = apt_pkg.Cache(OpNullProgress()) - except SystemError, e: + except SystemError as e: sys.stderr.write("Error: Opening the cache (%s)" % e) sys.exit(-1) @@ -87,7 +87,7 @@ def refreshdata (): # then a standard upgrade depcache.upgrade() - except SystemError, e: + except SystemError as e: sys.stderr.write("Error: Couldn't mark the upgrade (%s)" % e) sys.exit(-1) @@ -146,7 +146,7 @@ else: file = open(myfile, 'r+') updates = int(file.read()) if updates > 0: - print "[ \033[92m%d updates to install\033[0m: apt-get upgrade ]\n" % (updates) + print("[ \033[92m%d updates to install\033[0m: apt-get upgrade ]\n" % (updates))