[extensions-web/wip/api/v1: 3/17] management: fixed python 3 errors
- From: Yuri Konotopov <ykonotopov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web/wip/api/v1: 3/17] management: fixed python 3 errors
- Date: Sun, 28 Mar 2021 16:38:20 +0000 (UTC)
commit e0a9fb9defbcaa6fd473cc2b56271f2e3afd322f
Author: Yuri Konotopov <ykonotopov gnome org>
Date: Sat May 23 13:58:42 2020 +0400
management: fixed python 3 errors
sweettooth/extensions/management/commands/check_files.py | 6 +++---
sweettooth/extensions/management/commands/populatedownloads.py | 4 ++--
sweettooth/extensions/management/commands/searchextensions.py | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/sweettooth/extensions/management/commands/check_files.py
b/sweettooth/extensions/management/commands/check_files.py
index a25684f0..0178cbf3 100644
--- a/sweettooth/extensions/management/commands/check_files.py
+++ b/sweettooth/extensions/management/commands/check_files.py
@@ -27,11 +27,11 @@ class Command(BaseCommand):
else:
badversion = False
- except IOError, e:
+ except IOError as e:
self.error("[%s: %d] Unable to find zip file: %s" % (version.extension.name,
version.version, str(e)))
- except BadZipfile, e:
+ except BadZipfile as e:
self.error("[%s: %d] Bad zip file: %s" % (version.extension.name, version.version,
version.source.name))
- except ZlibError, e:
+ except ZlibError as e:
self.error("[%s: %d] Zlib error: %s" % (version.extension.name, version.version, str(e)))
if badversion:
diff --git a/sweettooth/extensions/management/commands/populatedownloads.py
b/sweettooth/extensions/management/commands/populatedownloads.py
index 73d558fa..6de99fcc 100644
--- a/sweettooth/extensions/management/commands/populatedownloads.py
+++ b/sweettooth/extensions/management/commands/populatedownloads.py
@@ -1,5 +1,5 @@
-from django.core.management.base import BaseCommand, CommandError
+from django.core.management.base import BaseCommand
from sweettooth.extensions.models import Extension
class Command(BaseCommand):
@@ -15,7 +15,7 @@ class Command(BaseCommand):
try:
ext = Extension.objects.get(uuid=uuid)
except Extension.DoesNotExist:
- print "Skipping", uuid
+ print("Skipping", uuid)
else:
ext.downloads = int(downloads, 10)
ext.save()
diff --git a/sweettooth/extensions/management/commands/searchextensions.py
b/sweettooth/extensions/management/commands/searchextensions.py
index 45c99366..7fefd6de 100644
--- a/sweettooth/extensions/management/commands/searchextensions.py
+++ b/sweettooth/extensions/management/commands/searchextensions.py
@@ -35,4 +35,4 @@ class Command(BaseCommand):
extensions = [extension_lookup[pk] for pk in pks]
for ext in extensions:
- print ext.name
+ print(ext.name)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]