瀏覽代碼

Use different method to compute ServicePort.repr
Workaround for https://bugs.python.org/issue24931

Signed-off-by: Joffrey F <[email protected]>

Joffrey F 8 年之前
父節點
當前提交
07680b77a6
共有 1 個文件被更改,包括 1 次插入1 次删除
  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):