mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 02:00:20 +00:00
make setup.py run on python3
This commit is contained in:
parent
0687e4461d
commit
b731ffd0ca
1 changed files with 8 additions and 3 deletions
11
setup.py
11
setup.py
|
@ -4,6 +4,8 @@
|
|||
The setup script for salt
|
||||
'''
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
# pylint: disable=C0111,E1101,E1103,F0401,W0611,W0201,W0232,R0201,R0902,R0903
|
||||
|
||||
# For Python 2.5. A no-op on 2.6 and above.
|
||||
|
@ -12,7 +14,10 @@ from __future__ import print_function, with_statement
|
|||
import os
|
||||
import sys
|
||||
import glob
|
||||
import urllib2
|
||||
try:
|
||||
from urllib2 import urlopen
|
||||
except ImportError:
|
||||
from urllib.request import urlopen
|
||||
from datetime import datetime
|
||||
# pylint: disable=E0611
|
||||
import distutils.dist
|
||||
|
@ -270,7 +275,7 @@ class CloudSdist(Sdist):
|
|||
)
|
||||
)
|
||||
except ImportError:
|
||||
req = urllib2.urlopen(url)
|
||||
req = urlopen(url)
|
||||
|
||||
if req.getcode() == 200:
|
||||
script_contents = req.read()
|
||||
|
@ -489,7 +494,7 @@ class InstallLib(install_lib):
|
|||
chmod.append(idx)
|
||||
for idx in chmod:
|
||||
filename = out[idx]
|
||||
os.chmod(filename, 0755)
|
||||
os.chmod(filename, 0o755)
|
||||
# <---- Custom Distutils/Setuptools Commands -------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue