File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -254,17 +254,18 @@ def __repr__(self):
254254 self .type ,
255255 self .proto )
256256 if not closed :
257+ # getsockname and getpeername may not be available on WASI.
257258 try :
258259 laddr = self .getsockname ()
259260 if laddr :
260261 s += ", laddr=%s" % str (laddr )
261- except error :
262+ except ( error , AttributeError ) :
262263 pass
263264 try :
264265 raddr = self .getpeername ()
265266 if raddr :
266267 s += ", raddr=%s" % str (raddr )
267- except error :
268+ except ( error , AttributeError ) :
268269 pass
269270 s += '>'
270271 return s
Original file line number Diff line number Diff line change 1+ Work around missing socket functions in :class: `~socket.socket `'s
2+ ``__repr__ ``.
Original file line number Diff line number Diff line change @@ -229,7 +229,8 @@ def main():
229229
230230 extmods = detect_extension_modules (args )
231231 omit_files = list (OMIT_FILES )
232- omit_files .extend (OMIT_NETWORKING_FILES )
232+ if sysconfig .get_platform ().startswith ("emscripten" ):
233+ omit_files .extend (OMIT_NETWORKING_FILES )
233234 for modname , modfiles in OMIT_MODULE_FILES .items ():
234235 if not extmods .get (modname ):
235236 omit_files .extend (modfiles )
You can’t perform that action at this time.
0 commit comments