summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r--Lib/distutils/command/build_py.py4
-rw-r--r--Lib/distutils/command/build_scripts.py4
-rw-r--r--Lib/distutils/command/install_scripts.py2
-rw-r--r--Lib/distutils/command/register.py2
4 files changed, 7 insertions, 5 deletions
diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py
index 52534bd..8f56090 100644
--- a/Lib/distutils/command/build_py.py
+++ b/Lib/distutils/command/build_py.py
@@ -114,7 +114,9 @@ class build_py (Command):
build_dir = os.path.join(*([self.build_lib] + package.split('.')))
# Length of path to strip from found files
- plen = len(src_dir)+1
+ plen = 0
+ if src_dir:
+ plen = len(src_dir)+1
# Strip directory from globbed filenames
filenames = [
diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py
index bda4480..511b82f 100644
--- a/Lib/distutils/command/build_scripts.py
+++ b/Lib/distutils/command/build_scripts.py
@@ -119,8 +119,8 @@ class build_scripts (Command):
if self.dry_run:
log.info("changing mode of %s", file)
else:
- oldmode = os.stat(file)[ST_MODE] & 07777
- newmode = (oldmode | 0555) & 07777
+ oldmode = os.stat(file)[ST_MODE] & 0o7777
+ newmode = (oldmode | 0o555) & 0o7777
if newmode != oldmode:
log.info("changing mode of %s from %o to %o",
file, oldmode, newmode)
diff --git a/Lib/distutils/command/install_scripts.py b/Lib/distutils/command/install_scripts.py
index fe93ef5..da2da35 100644
--- a/Lib/distutils/command/install_scripts.py
+++ b/Lib/distutils/command/install_scripts.py
@@ -53,7 +53,7 @@ class install_scripts (Command):
if self.dry_run:
log.info("changing mode of %s", file)
else:
- mode = ((os.stat(file)[ST_MODE]) | 0555) & 07777
+ mode = ((os.stat(file)[ST_MODE]) | 0o555) & 0o7777
log.info("changing mode of %s to %o", file, mode)
os.chmod(file, mode)
diff --git a/Lib/distutils/command/register.py b/Lib/distutils/command/register.py
index 2ddabad..53f4293 100644
--- a/Lib/distutils/command/register.py
+++ b/Lib/distutils/command/register.py
@@ -183,7 +183,7 @@ Your selection [default 1]: ''', end=' ')
username, password))
f.close()
try:
- os.chmod(rc, 0600)
+ os.chmod(rc, 0o600)
except:
pass
elif choice == '2':