From 99eee2363b4dddab56c3a617d89a683f08072d75 Mon Sep 17 00:00:00 2001 From: LecygneNoir Date: Sun, 19 Jan 2020 11:26:14 +0100 Subject: [PATCH] Test if using python3 at the beginning of the script, and change shebang to do not force python3, as it enforce default python3 value and thus the check failed even if python2 is used --- prismedia_upload.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/prismedia_upload.py b/prismedia_upload.py index 3a5e4f8..c72dd6e 100755 --- a/prismedia_upload.py +++ b/prismedia_upload.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # coding: utf-8 """ @@ -63,8 +63,11 @@ Languages: Japanese, Korean, Mandarin, Portuguese, Punjabi, Russian, Spanish """ -from os.path import dirname, realpath import sys +if sys.version_info[0] < 3: + raise Exception("Python 3 or a more recent version is required.") + +from os.path import dirname, realpath import datetime import locale import logging @@ -96,9 +99,6 @@ except ImportError: 'see https://github.com/ahupp/python-magic\n') exit(1) -if sys.version_info[0] < 3: - raise Exception("Python 3 or a more recent version is required.") - VERSION = "prismedia v0.7.1" VALID_PRIVACY_STATUSES = ('public', 'private', 'unlisted')