[Python-checkins] r64519 - python/trunk/Lib/multiprocessing/connection.py

benjamin.peterson python-checkins at python.org
Wed Jun 25 14:39:05 CEST 2008


Author: benjamin.peterson
Date: Wed Jun 25 14:39:05 2008
New Revision: 64519

Log:
use byte literals in multiprocessing

Modified:
   python/trunk/Lib/multiprocessing/connection.py

Modified: python/trunk/Lib/multiprocessing/connection.py
==============================================================================
--- python/trunk/Lib/multiprocessing/connection.py	(original)
+++ python/trunk/Lib/multiprocessing/connection.py	Wed Jun 25 14:39:05 2008
@@ -352,14 +352,9 @@
 
 MESSAGE_LENGTH = 20
 
-CHALLENGE = '#CHALLENGE#'
-WELCOME = '#WELCOME#'
-FAILURE = '#FAILURE#'
-
-if sys.version_info >= (3, 0):         # XXX can use bytes literals in 2.6/3.0
-    CHALLENGE = CHALLENGE.encode('ascii')
-    WELCOME = WELCOME.encode('ascii')
-    FAILURE = FAILURE.encode('ascii')
+CHALLENGE = b'#CHALLENGE#'
+WELCOME = b'#WELCOME#'
+FAILURE = b'#FAILURE#'
 
 def deliver_challenge(connection, authkey):
     import hmac


More information about the Python-checkins mailing list