mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Fix setup.py import subprocess.run (not supported on < py3.5)
This commit is contained in:
parent
a71fd2a75e
commit
060b8a8b9c
7
setup.py
7
setup.py
|
@ -12,8 +12,6 @@ Extra supported commands are:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# To use a consistent encoding
|
# To use a consistent encoding
|
||||||
from subprocess import run
|
|
||||||
from shutil import rmtree
|
|
||||||
from codecs import open
|
from codecs import open
|
||||||
from sys import argv
|
from sys import argv
|
||||||
from os import path
|
from os import path
|
||||||
|
@ -48,6 +46,11 @@ if __name__ == '__main__':
|
||||||
print('Done.')
|
print('Done.')
|
||||||
|
|
||||||
elif len(argv) >= 2 and argv[1] == 'pypi':
|
elif len(argv) >= 2 and argv[1] == 'pypi':
|
||||||
|
# Need python3.5 or higher, but Telethon is supposed to support 3.x
|
||||||
|
# Place it here since noone should be running ./setup.py pypi anyway
|
||||||
|
from subprocess import run
|
||||||
|
from shutil import rmtree
|
||||||
|
|
||||||
for x in ('build', 'dist', 'Telethon.egg-info'):
|
for x in ('build', 'dist', 'Telethon.egg-info'):
|
||||||
rmtree(x, ignore_errors=True)
|
rmtree(x, ignore_errors=True)
|
||||||
run('python3 setup.py sdist', shell=True)
|
run('python3 setup.py sdist', shell=True)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user