diff options
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 3dc6e0f..2601db0 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, rmtree -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) @@ -438,7 +438,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( |
