match: explicitly tests for None

Changeset ba7f2a1cc2d2 removed the mutable default value, but did not explicitly
tested for None. Such implicit testing can introduce semantic and performance
issue. We move to an explicit testing for None as recommended by PEP8:

https://www.python.org/dev/peps/pep-0008/#programming-recommendations
This commit is contained in:
Pierre-Yves David 2017-03-15 15:08:45 -07:00
parent 0d3c7adc2c
commit be968edfac

View File

@ -117,8 +117,10 @@ class match(object):
the same directory
'<something>' - a pattern of the specified default type
"""
include = include or []
exclude = exclude or []
if include is None:
include = []
if exclude is None:
exclude = []
self._root = root
self._cwd = cwd