Bug 1858509 add thread-safety annotations around MediaSourceDemuxer::mMonitor r=alwu
[gecko.git] / third_party / python / json_e / jsone / six.py
blob1ab9cd2d7df3564b61ef84fcc2195514be9a18aa
1 import sys
2 import operator
4 # https://github.com/benjaminp/six/blob/2c3492a9f16d294cd5e6b43d6110c5a3a2e58b4c/six.py#L818
7 def with_metaclass(meta, *bases):
8 """Create a base class with a metaclass."""
9 # This requires a bit of explanation: the basic idea is to make a dummy
10 # metaclass for one level of class instantiation that replaces itself with
11 # the actual metaclass.
12 class metaclass(meta):
14 def __new__(cls, name, this_bases, d):
15 return meta(name, bases, d)
16 return type.__new__(metaclass, 'temporary_class', (), {})
19 # https://github.com/benjaminp/six/blob/2c3492a9f16d294cd5e6b43d6110c5a3a2e58b4c/six.py#L578
20 if sys.version_info[0] == 3:
21 viewitems = operator.methodcaller("items")
22 else:
23 viewitems = operator.methodcaller("viewitems")