[PATCH] D55258: Python 2/3 compat - socket server

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 12 23:49:02 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL349010: Portable Python script across Python version (authored by serge_sans_paille, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D55258?vs=176572&id=178009#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55258/new/

https://reviews.llvm.org/D55258

Files:
  cfe/trunk/tools/scan-view/bin/scan-view


Index: cfe/trunk/tools/scan-view/bin/scan-view
===================================================================
--- cfe/trunk/tools/scan-view/bin/scan-view
+++ cfe/trunk/tools/scan-view/bin/scan-view
@@ -80,9 +80,12 @@
 
 
 def port_is_open(port):
-    import SocketServer
     try:
-        t = SocketServer.TCPServer((kDefaultHost, port), None)
+        import socketserver
+    except ImportError:
+        import SocketServer as socketserver
+    try:
+        t = socketserver.TCPServer((kDefaultHost, port), None)
     except:
         return False
     t.server_close()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55258.178009.patch
Type: text/x-patch
Size: 580 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181213/73f76d0a/attachment.bin>


More information about the llvm-commits mailing list