make sure py2 throws a deprecation notice

This commit is contained in:
Laura Liberda 2021-02-26 21:00:17 +01:00 committed by Dominika
parent 2748cc857a
commit 79278413a9
2 changed files with 9 additions and 4 deletions

View file

@ -1,7 +1,10 @@
#!/usr/bin/env python #!/usr/bin/env python3
# coding: utf-8 # coding: utf-8
from __future__ import unicode_literals import sys
if sys.version_info[0] == 2:
sys.exit('haruhi-dl no longer works on Python 2, use Python 3 instead')
__license__ = 'LGPL-3.0-or-later' __license__ = 'LGPL-3.0-or-later'
@ -9,7 +12,6 @@ import codecs
import io import io
import os import os
import random import random
import sys
from .options import ( from .options import (

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
from __future__ import unicode_literals from __future__ import unicode_literals
# Execute with # Execute with
@ -7,6 +7,9 @@ from __future__ import unicode_literals
import sys import sys
if sys.version_info[0] == 2:
sys.exit('haruhi-dl no longer works on Python 2, use Python 3 instead')
if __package__ is None and not hasattr(sys, 'frozen'): if __package__ is None and not hasattr(sys, 'frozen'):
# direct call of __main__.py # direct call of __main__.py
import os.path import os.path