Commits

Ginés Martínez Sánchez committed e982ac4 Draft

preparing version 0.5.0.

Comments (0)

Files changed (5)

             self._handshake_reading = False
             self._handshake_writing = False
             self.socket.do_handshake()
-        except ssl.SSLError, err:
+        except ssl.SSLError as err:
             if err.args[0] == ssl.SSL_ERROR_WANT_READ:
                 self._handshake_reading = True
                 return
                     self.socket.fileno(), peer, err)
                 return self.close()
             raise
-        except socket.error, err:
+        except socket.error as err:
             if err.args[0] in (errno.ECONNABORTED, errno.ECONNRESET):
                 return self.close()
         else:

ginsfsm/c_srv_sock.py

                     do_handshake_on_connect=False,
                     **self.config.ssl_options
                 )
-            except ssl.SSLError, err:
+            except ssl.SSLError as err:
                 if err.args[0] == ssl.SSL_ERROR_EOF:
                     return sock.close()
                 else:
                     raise
-            except socket.error, err:
+            except socket.error as err:
                 if err.args[0] == errno.ECONNABORTED:
                     return sock.close()
                 else:
 except NameError: # pragma: no cover
     input_ = input
 
-try:  # pragma: no cover
-    from UserDict import DictMixin
-except ImportError:  # pragma: no cover
-    from collections.UserDict import DictMixin
 
 try:
     from StringIO import StringIO as NativeIO
 # but it gets all exponential on certain patterns (such as too many trailing
 # dots), causing the regex matcher to never return.
 # This regex should avoid those problems.
-_URL_RE = re.compile(
-    ur"""\b((?:([\w-]+):(/{1,3})|www[.])(?:(?:(?:[^\s&()]|&amp;|&quot;)*(?:[^!"#$%&'()*+,.:;<=>?@\[\]^`{|}~\s]))|(?:\((?:[^\s&()]|&amp;|&quot;)*\)))+)"""
-)
+PY3 = sys.version_info[0] == 3
+if PY3:
+    _URL_RE = re.compile(
+        """\b((?:([\w-]+):(/{1,3})|www[.])(?:(?:(?:[^\s&()]|&amp;|&quot;)*(?:[^!"#$%&'()*+,.:;<=>?@\[\]^`{|}~\s]))|(?:\((?:[^\s&()]|&amp;|&quot;)*\)))+)"""
+    )
+else:
+    _URL_RE = re.compile(
+        ur"""\b((?:([\w-]+):(/{1,3})|www[.])(?:(?:(?:[^\s&()]|&amp;|&quot;)*(?:[^!"#$%&'()*+,.:;<=>?@\[\]^`{|}~\s]))|(?:\((?:[^\s&()]|&amp;|&quot;)*\)))+)"""
+    )
 
 
 def linkify(text, shorten=False, extra_params="",

ginsfsm/tests/test_gobj2.py

 
 def ac_wave(self, event):
     if event.origin == self.config.mymod:
-        print("    MINE %s! pulse %s" % (self.name, event.origin))
+        #print("    MINE %s! pulse %s" % (self.name, event.origin))
         self.count += 1
         return True
     return False