Patchwork [10,of,11] py3: replace types.NoneType with type(None)

login
register
mail settings
Submitter Pulkit Goyal
Date Feb. 23, 2018, 6:15 p.m.
Message ID <c8124f3591d41903f701.1519409723@workspace>
Download mbox | patch
Permalink /patch/28287/
State Accepted
Headers show

Comments

Pulkit Goyal - Feb. 23, 2018, 6:15 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1519390431 -19800
#      Fri Feb 23 18:23:51 2018 +0530
# Node ID c8124f3591d41903f701df60f6786db8c77fb13d
# Parent  1e72b28e804b014573a8e156ae46129f44979c51
py3: replace types.NoneType with type(None)

types.NoneType is not present in Python 3.

Patch

diff --git a/mercurial/fancyopts.py b/mercurial/fancyopts.py
--- a/mercurial/fancyopts.py
+++ b/mercurial/fancyopts.py
@@ -9,7 +9,6 @@  from __future__ import absolute_import
 
 import abc
 import functools
-import types
 
 from .i18n import _
 from . import (
@@ -222,7 +221,7 @@  class customopt(object):
 
 class _simpleopt(customopt):
     def _isboolopt(self):
-        return isinstance(self.defaultvalue, (bool, types.NoneType))
+        return isinstance(self.defaultvalue, (bool, type(None)))
 
     def newstate(self, oldstate, newparam, abort):
         return newparam