File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1505,6 +1505,7 @@ def update_metaclass(self, defn: ClassDef) -> None:
1505
1505
* __metaclass__ attribute in Python 2
1506
1506
* six.with_metaclass(M, B1, B2, ...)
1507
1507
* @six.add_metaclass(M)
1508
+ * future.utils.with_metaclass(M, B1, B2, ...)
1508
1509
"""
1509
1510
1510
1511
# Look for "__metaclass__ = <metaclass>" in Python 2
@@ -1525,7 +1526,8 @@ def update_metaclass(self, defn: ClassDef) -> None:
1525
1526
base_expr = defn .base_type_exprs [0 ]
1526
1527
if isinstance (base_expr , CallExpr ) and isinstance (base_expr .callee , RefExpr ):
1527
1528
base_expr .callee .accept (self )
1528
- if (base_expr .callee .fullname == 'six.with_metaclass'
1529
+ if (base_expr .callee .fullname in {'six.with_metaclass' ,
1530
+ 'future.utils.with_metaclass' }
1529
1531
and len (base_expr .args ) >= 1
1530
1532
and all (kind == ARG_POS for kind in base_expr .arg_kinds )):
1531
1533
with_meta_expr = base_expr .args [0 ]
Original file line number Diff line number Diff line change @@ -1269,6 +1269,7 @@ def update_metaclass(self, defn: ClassDef) -> None:
1269
1269
* __metaclass__ attribute in Python 2
1270
1270
* six.with_metaclass(M, B1, B2, ...)
1271
1271
* @six.add_metaclass(M)
1272
+ * future.utils.with_metaclass(M, B1, B2, ...)
1272
1273
"""
1273
1274
1274
1275
# Look for "__metaclass__ = <metaclass>" in Python 2
@@ -1289,7 +1290,8 @@ def update_metaclass(self, defn: ClassDef) -> None:
1289
1290
base_expr = defn .base_type_exprs [0 ]
1290
1291
if isinstance (base_expr , CallExpr ) and isinstance (base_expr .callee , RefExpr ):
1291
1292
base_expr .callee .accept (self )
1292
- if (base_expr .callee .fullname == 'six.with_metaclass'
1293
+ if (base_expr .callee .fullname in {'six.with_metaclass' ,
1294
+ 'future.utils.with_metaclass' }
1293
1295
and len (base_expr .args ) >= 1
1294
1296
and all (kind == ARG_POS for kind in base_expr .arg_kinds )):
1295
1297
with_meta_expr = base_expr .args [0 ]
You can’t perform that action at this time.
0 commit comments