internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: mesonbuild/meson

Issue:
Meson does not report clang-tidy exit code if invoked "manually (i.e. if run-clang-tidy(.py) is not in PATH)
Meson does not report clang-tidy exit code if invoked "manually (i.e. if run-clang-tidy(.py) is not in PATH). This is caused by ignoring the return value of `manual_clangformat()` in `clangformat()` within `mesonbuild/scripts/clangtidy.py`.


Discussion:

Resolving patch:
diff --git a/mesonbuild/scripts/clangtidy.py b/mesonbuild/scripts/clangtidy.py
--- a/mesonbuild/scripts/clangtidy.py
+++ b/mesonbuild/scripts/clangtidy.py
@@ -22,7 +22,7 @@
 
 from ..compilers import lang_suffixes
 
-def manual_clangformat(srcdir_name: str, builddir_name: str) -> int:
+def manual_clangtidy(srcdir_name: str, builddir_name: str) -> int:
     srcdir = pathlib.Path(srcdir_name)
     suffixes = set(lang_suffixes['c']).union(set(lang_suffixes['cpp']))
     suffixes.add('h')
@@ -39,7 +39,7 @@ def manual_clangformat(srcdir_name: str, builddir_name: str) -> int:
         [max(returncode, x.result().returncode) for x in futures]
     return returncode
 
-def clangformat(srcdir_name: str, builddir_name: str) -> int:
+def clangtidy(srcdir_name: str, builddir_name: str) -> int:
     run_clang_tidy = None
     for rct in ('run-clang-tidy', 'run-clang-tidy.py'):
         if shutil.which(rct):
@@ -49,10 +49,9 @@ def clangformat(srcdir_name: str, builddir_name: str) -> int:
         return subprocess.run([run_clang_tidy, '-p', builddir_name, '^(?!' + re.escape(builddir_name + os.path.sep) +').*$']).returncode
     else:
         print('Could not find run-clang-tidy, running checks manually.')
-        manual_clangformat(srcdir_name, builddir_name)
-    return 0
+        return manual_clangtidy(srcdir_name, builddir_name)
 
 def run(args: T.List[str]) -> int:
     srcdir_name = args[0]
     builddir_name = args[1]
-    return clangformat(srcdir_name, builddir_name)
+    return clangtidy(srcdir_name, builddir_name)


Test patch:
Repository: mesonbuild/meson

Issue:
Meson dies with a TypeError if project version number is an integer instead of a string
**Describe the bug**
If I mistakenly specify the project version number as an integer rather than a string, Meson prints a few pages of stack trace rather than a useful error message.  The last lines of the traceback are:

```
  File "/home/james/src/ubuntu/meson/mesonbuild/interpreter.py", line 3216, in func_project
    mlog.log('Project version:', mlog.bold(self.project_version))
  File "/home/james/src/ubuntu/meson/mesonbuild/mlog.py", line 225, in log
    arr = process_markup(args, True)
  File "/home/james/src/ubuntu/meson/mesonbuild/mlog.py", line 178, in process_markup
    arr.append(arg.get_text(keep))
  File "/home/james/src/ubuntu/meson/mesonbuild/mlog.py", line 128, in get_text
    text = self.code + self.text + AnsiDecorator.plain_code
TypeError: can only concatenate str (not "int") to str
```

**To Reproduce**
I can trigger this with the following trivial build file:

```
project('foo', 'C', version: 42)
```

**Expected behavior**
I would expect Meson to either error out telling me that the version number must be a string, or to actually accept the integer version number.  It would probably be more consistent to reject such projects, since that's effectively the current behaviour with the TypeError.

**system parameters**
* Ubuntu 20.04
* Python 3.8.5
* Meson 0.56.99 (from git at revision 8992729).
* Ninja 1.10.0


Discussion:

Resolving patch:
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -3175,6 +3175,8 @@ def func_project(self, node, args, kwargs):
             self.build.project_name = proj_name
         self.active_projectname = proj_name
         self.project_version = kwargs.get('version', 'undefined')
+        if not isinstance(self.project_version, str):
+            raise InvalidCode('The version keyword argument must be a string.')
         if self.build.project_version is None:
             self.build.project_version = self.project_version
         proj_license = mesonlib.stringlistify(kwargs.get('license', 'unknown'))


Test patch:
Repository: mesonbuild/meson

Issue:
Add support for C++20
Meson currently fails with

ERROR: Validation failed for option cpp_std: Value "c++20" (of type "string") for combo option "C++ language standard to use" is not one of the choices. Possible choices are (as string): "none", "c++98", "c++03", "c++11", "c++14", "c++17", "c++1z", "c++2a", "gnu++03", "gnu++11", "gnu++14", "gnu++17", "gnu++1z", "gnu++2a".

when `cpp_std` is set to `c++20`.


Discussion:

Resolving patch:
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -150,7 +150,9 @@ def _find_best_cpp_std(self, cpp_std: str) -> str:
             'c++14': 'c++1y',
             'gnu++14': 'gnu++1y',
             'c++17': 'c++1z',
-            'gnu++17': 'gnu++1z'
+            'gnu++17': 'gnu++1z',
+            'c++20': 'c++2a',
+            'gnu++20': 'gnu++2a',
         }
 
         # Currently, remapping is only supported for Clang, Elbrus and GCC
@@ -206,7 +208,8 @@ def get_options(self) -> 'OptionDictType':
         })
         opts['std'].choices = [  # type: ignore
             'none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z',
-            'c++2a', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a',
+            'c++2a', 'c++20', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z',
+            'gnu++2a', 'gnu++20',
         ]
         if self.info.is_windows() or self.info.is_cygwin():
             opts.update({
@@ -344,8 +347,8 @@ def get_options(self) -> 'OptionDictType':
         })
         opts['std'].choices = [  # type: ignore
             'none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z',
-            'c++2a', 'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z',
-            'gnu++2a',
+            'c++2a', 'c++20', 'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17',
+            'gnu++1z', 'gnu++2a', 'gnu++20',
         ]
         if self.info.is_windows() or self.info.is_cygwin():
             opts.update({


Test patch:
Repository: mesonbuild/meson

Issue:
Provide a way to install an empty directory
Sometimes you need to create an empty directory (for third-party plugins, fonts, themes,…) as part of the software install. 
It does not seem currently possible. Maybe allow passing an empty subdir name to install_subdir to do the trick ?


Discussion:
Is this issue being worked upon still ?
I have a requirement to create an empty directory at the /var/lib/ path of the target during the install time. 
I just blindly tried `install_subdir()` for a non-existing source directory and it looks like this works
```
$ ls
meson.build
$ cat  meson.build
project('test')
install_subdir('foobar', install_dir: get_option('prefix'))
$ meson build --prefix=$PWD/../_inst
...
$ ninja -C build install
$ ../_inst
└── foobar
1 directory, 0 files
```
If this is intended and not just by accident, documenting it would be a good solution to this bug.
I'm okay with making this a feature not an implementation detail, we should document it and add a test. @jpakkane, objections?

Resolving patch:
diff --git a/run_unittests.py b/run_unittests.py
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2224,6 +2224,7 @@ def test_install_subdir_introspection(self):
             'sub/sub1': 'share/sub1',
             'sub_elided': 'share',
             'nested_elided/sub': 'share',
+            'new_directory': 'share/new_directory',
         }
 
         self.assertEqual(len(intro), len(expected))


Test patch:
diff --git a/test cases/common/60 install subdir/meson.build b/test cases/common/60 install subdir/meson.build
--- a/test cases/common/60 install subdir/meson.build	
+++ b/test cases/common/60 install subdir/meson.build	
@@ -16,3 +16,6 @@ install_subdir('sub/sub1', install_dir : 'share')
 # strip_directory
 install_subdir('sub_elided', install_dir : 'share', strip_directory : true)
 install_subdir('nested_elided/sub', install_dir : 'share', strip_directory : true)
+
+# Create new empty directory that doesn't exist in the source tree
+install_subdir('new_directory', install_dir : 'share')
diff --git a/test cases/common/60 install subdir/test.json b/test cases/common/60 install subdir/test.json
--- a/test cases/common/60 install subdir/test.json	
+++ b/test cases/common/60 install subdir/test.json	
@@ -11,6 +11,7 @@
     {"type": "file", "file": "usr/share/sub1/third.dat"},
     {"type": "file", "file": "usr/share/sub1/sub2/data2.dat"},
     {"type": "file", "file": "usr/share/sub2/one.dat"},
-    {"type": "file", "file": "usr/share/sub2/dircheck/excluded-three.dat"}
+    {"type": "file", "file": "usr/share/sub2/dircheck/excluded-three.dat"},
+    {"type": "dir", "file": "usr/share/new_directory"}
   ]
 }
Repository: mesonbuild/meson

Issue:
compilers.py: cuda_buildtype_args is missing 'custom' entry, leading to KeyError
Following the advice in https://github.com/mesonbuild/meson/issues/8334 to use built-in cuda support in meson I attempted to do debug build with optimizations and I got the exception below:

```
  Traceback (most recent call last):                                                                  
  File "/home/aciarkowski/.local/lib/python3.6/site-packages/mesonbuild/mesonmain.py", line 140, in run
    return options.run_func(options)
  File "/home/aciarkowski/.local/lib/python3.6/site-packages/mesonbuild/msetup.py", line 253, in run
    app.generate()
  File "/home/aciarkowski/.local/lib/python3.6/site-packages/mesonbuild/msetup.py", line 161, in generate
    self._generate(env)
  File "/home/aciarkowski/.local/lib/python3.6/site-packages/mesonbuild/msetup.py", line 223, in _generate
    intr.backend.generate()
  File "/home/aciarkowski/.local/lib/python3.6/site-packages/mesonbuild/backend/ninjabackend.py", line 519, in generate
    self.generate_target(t)
  File "/home/aciarkowski/.local/lib/python3.6/site-packages/mesonbuild/backend/ninjabackend.py", line 837, in generate_target
    obj_list.append(self.generate_single_compile(target, src, False, [], header_deps))
  File "/home/aciarkowski/.local/lib/python3.6/site-packages/mesonbuild/backend/ninjabackend.py", line 2350, in generate_single_compile
    commands = self._generate_single_compile(target, compiler, is_generated)
  File "/home/aciarkowski/.local/lib/python3.6/site-packages/mesonbuild/backend/ninjabackend.py", line 2284, in _generate_single_compile
    commands += self.generate_basic_compiler_args(target, compiler, no_warn_args)
  File "/home/aciarkowski/.local/lib/python3.6/site-packages/mesonbuild/backend/backends.py", line 704, in generate_basic_compiler_args
    commands += compiler.get_buildtype_args(self.get_option_for_target('buildtype', target))
  File "/home/aciarkowski/.local/lib/python3.6/site-packages/mesonbuild/compilers/cuda.py", line 268, in get_buildtype_args
    return cuda_buildtype_args[buildtype] + self._to_host_flags(host_args)
  KeyError: 'custom'
```

Which leads to the definition of cuda_buildtype_args:

https://github.com/mesonbuild/meson/blob/5f697358f0e4249c103f4325424e5ca725ee5261/mesonbuild/compilers/compilers.py#L177




Discussion:
@jpakkane this should be pretty easy to fix, so we should probably fix it before the release. I'll see if i can get a chance to look at it before Sunday, but someone else could easily beat me to it.

Resolving patch:
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -179,6 +179,7 @@ class CompileCheckMode(enum.Enum):
                        'debugoptimized': [],
                        'release': [],
                        'minsize': [],
+                       'custom': [],
                        }  # type: T.Dict[str, T.List[str]]
 java_buildtype_args = {'plain': [],
                        'debug': ['-g'],


Test patch:
Repository: mesonbuild/meson

Issue:
Meson emits incorrect warning when uninstalled_variables keyword is added to pkgconfig generator 
Meson incorrectly emits warning messages
`WARNING: Passed invalid keyword argument "uninstalled_variables".`
`WARNING: This will become a hard error in the future.`
when the uninstalled_variables keyword is added to a pkgconfig.generate() statement.

The variables are correctly added to the uninstalled .pc file.

meson version 0.57.1 
ubuntu 20.04 LTS


Discussion:

Resolving patch:
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
--- a/mesonbuild/modules/pkgconfig.py
+++ b/mesonbuild/modules/pkgconfig.py
@@ -445,7 +445,7 @@ def generate_uninstalled_cflags(libs):
     @permittedKwargs({'libraries', 'version', 'name', 'description', 'filebase',
                       'subdirs', 'requires', 'requires_private', 'libraries_private',
                       'install_dir', 'extra_cflags', 'variables', 'url', 'd_module_versions',
-                      'dataonly', 'conflicts'})
+                      'dataonly', 'conflicts', 'uninstalled_variables'})
     def generate(self, state, args, kwargs):
         default_version = state.project_version['version']
         default_install_dir = None


Test patch:
Repository: mesonbuild/meson

Issue:
no string.replace method
Currently the only way to perform an operation similar to pythons `str.replace(old, new)` is with `new.join(str.split(old))` which feels clunky. A `str.replace(old, new)` method would be a welcome addition.


Discussion:

Resolving patch:
diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py
--- a/mesonbuild/interpreterbase.py
+++ b/mesonbuild/interpreterbase.py
@@ -1192,6 +1192,13 @@ def string_method_call(self, obj: str, method_name: str, posargs: T.List[TYPE_nv
                     raise InterpreterException('substring() argument must be an int')
                 end = posargs[1]
             return obj[start:end]
+        elif method_name == 'replace':
+            FeatureNew.single_use('str.replace', '0.58.0', self.subproject)
+            if len(posargs) != 2:
+                raise InterpreterException('replace() takes exactly two arguments.')
+            if not isinstance(posargs[0], str) or not isinstance(posargs[1], str):
+                raise InterpreterException('replace() requires that both arguments be strings')
+            return obj.replace(posargs[0], posargs[1])
         raise InterpreterException('Unknown method "%s" for a string.' % method_name)
 
     def format_string(self, templ: str, args: T.List[TYPE_nvar]) -> str:


Test patch:
diff --git a/test cases/common/36 string operations/meson.build b/test cases/common/36 string operations/meson.build
--- a/test cases/common/36 string operations/meson.build	
+++ b/test cases/common/36 string operations/meson.build	
@@ -19,6 +19,10 @@ long = 'abcde'
 prefix = 'abc'
 suffix = 'cde'
 
+assert(long.replace('b', 'd') == 'adcde')
+assert(long.replace('z', 'x') == long)
+assert(long.replace(prefix, suffix) == 'cdede')
+
 assert(long.startswith(prefix), 'Prefix.')
 
 assert(not long.startswith(suffix), 'Not prefix.')
@@ -71,7 +75,7 @@ assert(version_number.version_compare('<2.0'), 'Version_compare major less broke
 assert(version_number.version_compare('>0.9'), 'Version_compare major greater broken')
 
 assert(' spaces	tabs	'.strip() == 'spaces	tabs', 'Spaces and tabs badly stripped')
-assert(''' 
+assert('''
 multiline string	'''.strip() == '''multiline string''', 'Newlines badly stripped')
 assert('"1.1.20"'.strip('"') == '1.1.20', '" badly stripped')
 assert('"1.1.20"'.strip('".') == '1.1.20', '". badly stripped')
Repository: mesonbuild/meson

Issue:
OpenMP dependency explodes if version is not found
Using GOMP with the C++ flag `-fdirectives-only` causes Meson to miss a dictionary lookup, and instead of getting an "not found" we get a python backtrace.

See [upstream issue](https://gitlab.freedesktop.org/mesa/mesa/-/issues/4632).


Discussion:

Resolving patch:
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
--- a/mesonbuild/dependencies/misc.py
+++ b/mesonbuild/dependencies/misc.py
@@ -91,7 +91,13 @@ def __init__(self, environment, kwargs):
             openmp_date = None
 
         if openmp_date:
-            self.version = self.VERSIONS[openmp_date]
+            try:
+                self.version = self.VERSIONS[openmp_date]
+            except KeyError:
+                mlog.debug(f'Could not find an OpenMP version matching {openmp_date}')
+                if openmp_date == '_OPENMP':
+                    mlog.debug('This can be caused by flags such as gcc\'s `-fdirectives-only`, which affect preprocessor behavior.')
+                return
             # Flang has omp_lib.h
             header_names = ('omp.h', 'omp_lib.h')
             for name in header_names:


Test patch:
Repository: mesonbuild/meson

Issue:
default language is 'cs' on almost empty project
**Describe the bug**
Meson seems to think that a project with just a COPYING and a README.md file is a C# project

**To Reproduce**
create a directory in `/tmp/aa` with the following files only:

README.md
```
# title

Paragraph
```

COPYING
```
test
```

then do `meson init .` and the language meson uses is `'cs'`:
```
Using "aa" (name of current directory) as project name.
Using "aa" (project name) as name of executable to build.
Detected language: cs
Generated meson.build file:

project('aa', 'cs',
  version : '0.1',
  default_options : ['warning_level=3'])

executable('aa',
           '.',
           install : true)
```

**Expected behavior**
Since no language is currently used in the project use the default (`'c'`)

**system parameters**
* Is this a [cross build](https://mesonbuild.com/Cross-compilation.html) or just a plain native build (for the same computer)? N/A
* what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.) Parabola (Arch Linux based)
* what Python version are you using Python 3.9.5
* what `meson --version`   0.58.1
* what `ninja --version` if it's a Ninja build 1.10.2



Discussion:

Resolving patch:
diff --git a/mesonbuild/minit.py b/mesonbuild/minit.py
--- a/mesonbuild/minit.py
+++ b/mesonbuild/minit.py
@@ -105,7 +105,7 @@ def autodetect_options(options: 'argparse.Namespace', sample: bool = False) -> N
             if f.suffix in ('.cc', '.cpp'):
                 options.language = 'cpp'
                 break
-            if f.suffix in '.cs':
+            if f.suffix == '.cs':
                 options.language = 'cs'
                 break
             if f.suffix == '.cu':


Test patch:
Repository: mesonbuild/meson

Issue:
get_variable with a file object as default value: Argument of type File is not held by an ObjectHolder
**Describe the bug**
After updating Meson, I see this error in a previously working build:

```
build/analysis/vale/meson.build:24:0: ERROR: Argument build/analysis/vale/vale-styleguide/config/documentation.vale.ini of type File is not held by an ObjectHolder.

    This is a Meson bug and should be reported!
```

The file is being specified in this manner:

```
# Supply a style file, which will use this file instead of the default .vale.ini
vale_config_file = get_variable('vale_config_file',
	files('vale-styleguide/config/documentation.vale.ini'))
```

The default variable option is being used - I'm not overriding it.

The same is happening in a Doxygen module I use:

```
doxyfile_input = get_variable('doxyfile_input', files('Doxyfile.in'))
```

I tried moving the file object into another variable:

```
vale_default_config_file = files('vale-styleguide/config/documentation.vale.ini')
vale_config_file = get_variable('vale_config_file', vale_default_config_file)
```

With teh same result - the error is reported on the `get_variable` line.

**system parameters**
* Is this a [cross build](https://mesonbuild.com/Cross-compilation.html) or just a plain native build (for the same computer)? **native**
* what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.) **MacOS 10.15.7**
* what Python version are you using e.g. 3.8.0 **Python 3.9.6**
* what `meson --version` **0.59.0.rc1**



Discussion:
Went back to 0.58.1 - the error is not present in that build.

Resolving patch:
diff --git a/mesonbuild/interpreterbase/_unholder.py b/mesonbuild/interpreterbase/_unholder.py
--- a/mesonbuild/interpreterbase/_unholder.py
+++ b/mesonbuild/interpreterbase/_unholder.py
@@ -22,9 +22,9 @@ def _unholder(obj: T.Union[TYPE_var, InterpreterObject], *, permissive: bool = F
     if isinstance(obj, (int, bool, str)):
         return obj
     elif isinstance(obj, list):
-        return [_unholder(x) for x in obj]
+        return [_unholder(x, permissive=permissive) for x in obj]
     elif isinstance(obj, dict):
-        return {k: _unholder(v) for k, v in obj.items()}
+        return {k: _unholder(v, permissive=permissive) for k, v in obj.items()}
     elif isinstance(obj, ObjectHolder):
         assert isinstance(obj.held_object, HoldableObject)
         return obj.held_object


Test patch:
diff --git a/test cases/common/242 set and get variable/meson.build b/test cases/common/242 set and get variable/meson.build
--- a/test cases/common/242 set and get variable/meson.build	
+++ b/test cases/common/242 set and get variable/meson.build	
@@ -41,6 +41,8 @@ assert(get_variable('var9') == 'test2.txt')
 assert(not is_disabler(get_variable('var0')))
 assert(not is_disabler(get_variable('var0', var8)))
 assert(not is_disabler(get_variable('----', var8)))
+assert(not is_disabler(get_variable('----', [var8])))
+assert(not is_disabler(get_variable('----', {'asd': var8})))
 
 # test dict get
 dict = {'a': var2}
Repository: mesonbuild/meson

Issue:
`subprojects purge` should not follow symbolic links
**Describe the bug**
`meson subprojects purge` currently follows symbolic links. That is, if `subprojects/foo` is a symbolic link to `/home/reimu/git/foo`, then `meson subprojects purge` will offer to delete the actual `/home/reimu/git/foo` directory instead of the symbolic link. This is dangerous and makes no sense; I sometimes use symbolic links like that to replace a wrap dependency with my own version locally, and I wouldn't like it to get wiped.

**To Reproduce**
Setup:
```bash
cd /tmp
mkdir foreignproj
mkdir myproj
cd myproj
meson init
mkdir subprojects
ln -s ../../foreignproj subprojects/foo
cat <<EOF > subprojects/foo.wrap
[wrap-git]
directory=foo
url=https://example.com/foo.git
EOF
```
Purge:
```
$ pwd
/tmp/myproj
$ file /tmp/foreignproj
/tmp/foreignproj: directory
$ file subprojects/foo
subprojects/foo: symbolic link to ../../foreignproj
$ meson subprojects purge --confirm
Deleting /tmp/foreignproj
$ file /tmp/foreignproj
/tmp/foreignproj: cannot open `/tmp/foreignproj' (No such file or directory)
$ file subprojects/foo
subprojects/foo: broken symbolic link to ../../foreignproj
```

**Expected behavior**
`meson subprojects purge` should remove the symbolic link and not touch the real directory.

**system parameters**
* what operating system: openSUSE Tumbleweed
* what Python version are you using: 3.8.10
* what `meson --version`: 0.58.999 (6fb2f8637)
* what `ninja --version`: 1.10.2



Discussion:

Resolving patch:
diff --git a/mesonbuild/msubprojects.py b/mesonbuild/msubprojects.py
--- a/mesonbuild/msubprojects.py
+++ b/mesonbuild/msubprojects.py
@@ -430,7 +430,10 @@ def purge(self) -> bool:
             except FileNotFoundError:
                 pass
 
-        subproject_source_dir = Path(self.repo_dir).resolve()
+        # NOTE: Do not use .resolve() here; the subproject directory may be a symlink
+        subproject_source_dir = Path(self.repo_dir)
+        # Resolve just the parent, just to print out the full path
+        subproject_source_dir = subproject_source_dir.parent.resolve() / subproject_source_dir.name
 
         # Don't follow symlink. This is covered by the next if statement, but why
         # not be doubly sure.


Test patch: