diff options
| author | ?ric Araujo <merwok@netwok.org> | 2011-11-20 19:45:31 +0100 |
|---|---|---|
| committer | ?ric Araujo <merwok@netwok.org> | 2011-11-20 19:45:31 +0100 |
| commit | 51a3faa30a6e4c8493bc51a2c6de3272fae2ff88 (patch) | |
| tree | 394b7ede35dfb934fa3241ca6efcadc0fe4e0510 /distutils2/command/cmd.py | |
| parent | 5bf02c43b4e6e8e8a23bb4b5269200b66ecfc4f2 (diff) | |
| parent | e910765752824482f8659d4f725ebd5fb84cc5ba (diff) | |
| download | disutils2-51a3faa30a6e4c8493bc51a2c6de3272fae2ff88.tar.gz | |
Branch merge
Diffstat (limited to 'distutils2/command/cmd.py')
| -rw-r--r-- | distutils2/command/cmd.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/distutils2/command/cmd.py b/distutils2/command/cmd.py index 1cdae14..6ef7554 100644 --- a/distutils2/command/cmd.py +++ b/distutils2/command/cmd.py @@ -8,7 +8,7 @@ from distutils2.errors import PackagingOptionError from distutils2._backport.shutil import copyfile, move, make_archive -class Command(object): +class Command: """Abstract base class for defining command classes, the "worker bees" of Packaging. A useful analogy for command classes is to think of them as subroutines with local variables called "options". The options @@ -216,7 +216,7 @@ class Command(object): if val is None: setattr(self, option, default) return default - elif not isinstance(val, basestring): + elif not isinstance(val, str): raise PackagingOptionError("'%s' must be a %s (got `%s`)" % (option, what, val)) return val @@ -236,14 +236,14 @@ class Command(object): val = getattr(self, option) if val is None: return - elif isinstance(val, basestring): + elif isinstance(val, str): setattr(self, option, re.split(r',\s*|\s+', val)) else: if isinstance(val, list): # checks if all elements are str ok = True for element in val: - if not isinstance(element, basestring): + if not isinstance(element, str): ok = False break else: @@ -351,7 +351,7 @@ class Command(object): def execute(self, func, args, msg=None, level=1): util.execute(func, args, msg, dry_run=self.dry_run) - def mkpath(self, name, mode=00777, dry_run=None): + def mkpath(self, name, mode=0o777, dry_run=None): if dry_run is None: dry_run = self.dry_run name = os.path.normpath(name) @@ -424,7 +424,7 @@ class Command(object): skip_msg = "skipping %s (inputs unchanged)" % outfile # Allow 'infiles' to be a single string - if isinstance(infiles, basestring): + if isinstance(infiles, str): infiles = (infiles,) elif not isinstance(infiles, (list, tuple)): raise TypeError( |
