summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2018-11-02 23:09:27 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2018-11-09 00:31:24 -0800
commita41bce2148b185142052b237d73ab2e5e401f72d (patch)
tree1357a539401b3928bbe6c338f176ea2cdd63f222 /lib
parent1137b183e32aae467b08be36d7223172d5d01337 (diff)
downloadspack-a41bce2148b185142052b237d73ab2e5e401f72d.tar.gz
spack-a41bce2148b185142052b237d73ab2e5e401f72d.tar.bz2
spack-a41bce2148b185142052b237d73ab2e5e401f72d.tar.xz
spack-a41bce2148b185142052b237d73ab2e5e401f72d.zip
fix bad regular expressions and docstrings with '\'
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/llnl/util/lang.py6
-rw-r--r--lib/spack/spack/test/conftest.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/spack/llnl/util/lang.py b/lib/spack/llnl/util/lang.py
index b2d582db5a..0a86896f5b 100644
--- a/lib/spack/llnl/util/lang.py
+++ b/lib/spack/llnl/util/lang.py
@@ -460,11 +460,11 @@ def pretty_string_to_date(date_str, now=None):
now = now or datetime.now()
# datetime formats
- pattern[re.compile('^\d{4}$')] = lambda x: datetime.strptime(x, '%Y')
- pattern[re.compile('^\d{4}-\d{2}$')] = lambda x: datetime.strptime(
+ pattern[re.compile(r'^\d{4}$')] = lambda x: datetime.strptime(x, '%Y')
+ pattern[re.compile(r'^\d{4}-\d{2}$')] = lambda x: datetime.strptime(
x, '%Y-%m'
)
- pattern[re.compile('^\d{4}-\d{2}-\d{2}$')] = lambda x: datetime.strptime(
+ pattern[re.compile(r'^\d{4}-\d{2}-\d{2}$')] = lambda x: datetime.strptime(
x, '%Y-%m-%d'
)
diff --git a/lib/spack/spack/test/conftest.py b/lib/spack/spack/test/conftest.py
index a13444a1a8..9fe53b8f66 100644
--- a/lib/spack/spack/test/conftest.py
+++ b/lib/spack/spack/test/conftest.py
@@ -310,7 +310,7 @@ def mutable_config(tmpdir_factory, configuration_dir, config):
def _populate(mock_db):
- """Populate a mock database with packages.
+ r"""Populate a mock database with packages.
Here is what the mock DB looks like: