From 0f98233875282c3cde49e946a06820dbb922cd55 Mon Sep 17 00:00:00 2001 From: Philip Jenvey Date: Tue, 27 Aug 2013 15:36:06 -0700 Subject: utilize the tuple form of starts/endswith --- pyramid/path.py | 2 +- pyramid/scaffolds/copydir.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyramid/path.py b/pyramid/path.py index ab39a85d9..eb92ea62b 100644 --- a/pyramid/path.py +++ b/pyramid/path.py @@ -324,7 +324,7 @@ class DottedNameResolver(Resolver): def _pkg_resources_style(self, value, package): """ package.module:attr style """ - if value.startswith('.') or value.startswith(':'): + if value.startswith(('.', ':')): if not package: raise ValueError( 'relative name %r irresolveable without package' % (value,) diff --git a/pyramid/scaffolds/copydir.py b/pyramid/scaffolds/copydir.py index 7864dd1a1..3b871dc19 100644 --- a/pyramid/scaffolds/copydir.py +++ b/pyramid/scaffolds/copydir.py @@ -156,9 +156,9 @@ def should_skip_file(name): """ if name.startswith('.'): return 'Skipping hidden file %(filename)s' - if name.endswith('~') or name.endswith('.bak'): + if name.endswith(('~', '.bak')): return 'Skipping backup file %(filename)s' - if name.endswith('.pyc') or name.endswith('.pyo'): + if name.endswith(('.pyc', '.pyo')): return 'Skipping %s file ' % os.path.splitext(name)[1] + '%(filename)s' if name.endswith('$py.class'): return 'Skipping $py.class file %(filename)s' -- cgit v1.2.3