Explorar o código

Merge pull request #4798 from shin-/4729-serviceport_repr

Use different method to compute ServicePort.repr
Joffrey F %!s(int64=8) %!d(string=hai) anos
pai
achega
cb457a82f1
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      compose/config/types.py

+ 1 - 1
compose/config/types.py

@@ -306,7 +306,7 @@ class ServicePort(namedtuple('_ServicePort', 'target published protocol mode ext
 
     def repr(self):
         return dict(
-            [(k, v) for k, v in self._asdict().items() if v is not None]
+            [(k, v) for k, v in zip(self._fields, self) if v is not None]
         )
 
     def legacy_repr(self):