diff --git a/pyupgrade.py b/pyupgrade.py
index 6f99694..1a80af6 100644
--- a/pyupgrade.py
+++ b/pyupgrade.py
@@ -2039,6 +2039,12 @@ def _fix_py3_plus(contents_text):  # type: (str) -> str
             func_args, end = _parse_call_args(tokens, j)
             if len(func_args) == 1:
                 tmpl = WITH_METACLASS_NO_BASES_TMPL
+            elif len(func_args) == 2:
+                base = tokens_to_src(tokens[slice(*func_args[1])]).strip()
+                if base == 'object':
+                    tmpl = WITH_METACLASS_NO_BASES_TMPL
+                else:
+                    tmpl = WITH_METACLASS_BASES_TMPL
             else:
                 tmpl = WITH_METACLASS_BASES_TMPL
             _replace_call(tokens, i, end, func_args, tmpl)

metaclass extending object takes two passes to resolve
minor thing, would be a useful improvement:

```python
class C(six.with_metaclass(abc.ABCMeta, object)): pass
```


diff --git a/tests/six_test.py b/tests/six_test.py
index c58f5fc..18b35f4 100644
--- a/tests/six_test.py
+++ b/tests/six_test.py
@@ -260,6 +260,11 @@ def test_fix_six_noop(s):
 
             'class C(B, metaclass=M): pass',
         ),
+        (
+            'class C(six.with_metaclass(M, B1, B2)): pass',
+
+            'class C(B1, B2, metaclass=M): pass',
+        ),
         (
             'from six import with_metaclass\n'
             'class C(with_metaclass(M, B)): pass\n',
@@ -281,6 +286,15 @@ def test_fix_six_noop(s):
 
             id='weird spacing with_metaclass',
         ),
+        pytest.param(
+            'from six import with_metaclass\n'
+            'class C(with_metaclass(M, object)): pass',
+
+            'from six import with_metaclass\n'
+            'class C(metaclass=M): pass',
+
+            id='elide object base in with_metaclass',
+        ),
         pytest.param(
             '@six.add_metaclass(M)\n'
             'class C: pass\n',

pip install -e .
parse_log_pytest
pytest
pytest
3.9
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
exceptiongroup @ file:///croot/exceptiongroup_1706031385326/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
packaging @ file:///croot/packaging_1734472117206/work
pluggy @ file:///croot/pluggy_1733169602837/work
pytest @ file:///croot/pytest_1738938843180/work
-e git+https://github.com/asottile/pyupgrade.git@272ddebd33869c9d053710f40b19054a6e8d7684#egg=pyupgrade
tokenize_rt==6.1.0
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work

name: pyupgrade
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - exceptiongroup=1.2.0=py39h06a4308_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - packaging=24.2=py39h06a4308_0
  - pip=25.0=py39h06a4308_0
  - pluggy=1.5.0=py39h06a4308_0
  - pytest=8.3.4=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py39h06a4308_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - tokenize-rt==6.1.0
prefix: /opt/conda/envs/pyupgrade

tests/six_test.py::test_fix_six[elide
tests/six_test.py::test_fix_six_noop[x tests/six_test.py::test_fix_six_noop[from tests/six_test.py::test_fix_six_noop[@mydec\nclass tests/six_test.py::test_fix_six_noop[print(six.raise_from(exc, tests/six_test.py::test_fix_six_noop[print(six.b("\xa3"))] tests/six_test.py::test_fix_six_noop[print(six.b( tests/six_test.py::test_fix_six_noop[class tests/six_test.py::test_fix_six_noop[six.reraise(*err)] tests/six_test.py::test_fix_six_noop[six.b(*a)] tests/six_test.py::test_fix_six_noop[six.u(*a)] tests/six_test.py::test_fix_six_noop[@six.add_metaclass(*a)\nclass tests/six_test.py::test_fix_six_noop[(\n tests/six_test.py::test_fix_six_noop[next()] tests/six_test.py::test_fix_six[isinstance(s, tests/six_test.py::test_fix_six[weird tests/six_test.py::test_fix_six[issubclass(tp, tests/six_test.py::test_fix_six[STRING_TYPES tests/six_test.py::test_fix_six[from tests/six_test.py::test_fix_six[six.b("123")-b"123"] tests/six_test.py::test_fix_six[six.b(r"123")-br"123"] tests/six_test.py::test_fix_six[six.b("\\x12\\xef")-b"\\x12\\xef"] tests/six_test.py::test_fix_six[six.ensure_binary("foo")-b"foo"] tests/six_test.py::test_fix_six[six.byte2int(b"f")-b"f"[0]] tests/six_test.py::test_fix_six[@six.python_2_unicode_compatible\nclass tests/six_test.py::test_fix_six[@six.python_2_unicode_compatible\n@other_decorator\nclass tests/six_test.py::test_fix_six[six.get_unbound_function(meth)\n-meth\n] tests/six_test.py::test_fix_six[six.indexbytes(bs, tests/six_test.py::test_fix_six[six.assertCountEqual(\n tests/six_test.py::test_fix_six[six.raise_from(exc, tests/six_test.py::test_fix_six[six.reraise(tp, tests/six_test.py::test_fix_six[six.reraise(\n tests/six_test.py::test_fix_six[class tests/six_test.py::test_fix_six[basic tests/six_test.py::test_fix_six[add_metaclass, tests/six_test.py::test_fix_six[six.itervalues] tests/six_test.py::test_fix_six[six.itervalues tests/six_test.py::test_fix_base_classes[import tests/six_test.py::test_fix_base_classes[from tests/six_test.py::test_fix_base_classes[class tests/six_test.py::test_fix_base_classes_py3only[class tests/six_test.py::test_fix_base_classes_py3only[from
pyupgrade.py
pyupgrade.py