Ignore:
Timestamp:
05/01/12 10:58:30 (2 years ago)
Author:
wehart
Message:

Python 3.x portability fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyutilib.pyro/trunk/pyutilib/pyro/client.py

    r2626 r2831  
    2525        self.ns = get_nameserver(host) 
    2626        if self.ns is None: 
    27             raise RuntimeError, "Client failed to locate Pyro name server on the network!" 
    28         print 'Attempting to find Pyro dispatcher object...' 
     27            raise RuntimeError("Client failed to locate Pyro name server on the network!") 
     28        print('Attempting to find Pyro dispatcher object...') 
    2929        self.URI = None 
    3030        for i in xrange(0,num_dispatcher_tries):  
    3131            try: 
    3232                self.URI=self.ns.resolve(group+".dispatcher") 
    33                 print 'Dispatcher Object URI:',self.URI 
     33                print('Dispatcher Object URI: '+self.URI) 
    3434                break 
    35             except NamingError, x: 
     35            except NamingError(x): 
    3636                pass 
    3737            time.sleep(1) 
    38             print "Failed to find dispatcher object from name server - trying again." 
     38            print("Failed to find dispatcher object from name server - trying again.") 
    3939        if self.URI is None: 
    40             print 'Could not find dispatcher object, nameserver says:',x 
     40            print('Could not find dispatcher object, nameserver says:'+str(x)) 
    4141            raise SystemExit 
    4242        self.set_group(group) 
    4343        self.CLIENTNAME = "%d@%s" % (os.getpid(), socket.gethostname()) 
    44         print "This is client",self.CLIENTNAME 
     44        print("This is client "+self.CLIENTNAME) 
    4545 
    4646    def set_group(self, group): 
     
    5555        if verbose is True: 
    5656            if self.type is not None: 
    57                 print "Adding task",task.id,"to dispatcher queue with type=",self.type 
     57                print("Adding task "+str(task.id)+" to dispatcher queue with type="+str(self.type)) 
    5858            else: 
    59                 print "Adding task",task.id,"to dispatcher queue" 
     59                print("Adding task"+str(task.id)+"to dispatcher queue") 
    6060        if override_type is not None: 
    6161           self.dispatcher.add_task(task, type=override_type) 
Note: See TracChangeset for help on using the changeset viewer.