diff --git a/loopy/context_matching.py b/loopy/context_matching.py
index eb85c1dd0a4c0b7b55607ec5358d9e3ef18470cb..b259a0ddd33e20d98bf628db0c993501908bcb36 100644
--- a/loopy/context_matching.py
+++ b/loopy/context_matching.py
@@ -27,7 +27,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 """
 
-import types
+NoneType = type(None)
 
 
 # {{{ id match objects
@@ -43,7 +43,7 @@ class RegexIdentifierMatch(object):
         self.tag_re = tag_re
 
     def __call__(self, identifier, tags):
-        assert isinstance(tags, (tuple, types.NoneType))
+        assert isinstance(tags, (tuple, NoneType))
 
         if self.tag_re is None:
             return self.id_re.match(identifier) is not None