Edit

IABSD.fr/ports/sysutils/rdiff-backup/patches/patch-rdiff_backup_SetConnections_py

Branch :

  • Show log

    Commit

  • Author : pea
    Date : 2010-09-15 09:02:50
    Hash : 7729581b
    Message : Fix a deprecationWarning with python 2.6 ok jasper@

  • sysutils/rdiff-backup/patches/patch-rdiff_backup_SetConnections_py
  • $OpenBSD: patch-rdiff_backup_SetConnections_py,v 1.1 2010/09/15 09:02:50 pea Exp $
    --- rdiff_backup/SetConnections.py.orig	Mon Mar 16 15:36:21 2009
    +++ rdiff_backup/SetConnections.py	Wed Sep 15 09:54:41 2010
    
    Bugfix: DeprecationWarning: os.popen2 is deprecated
    cf http://bugs.gentoo.org/attachment.cgi?id=216585&action=view
    
    @@ -135,10 +135,10 @@ def init_connection(remote_cmd):
     	if not remote_cmd: return Globals.local_connection
     
     	Log("Executing " + remote_cmd, 4)
    -	if os.name == "nt":
    +	if map(int, sys.version.split()[0].split('.')[:2]) >= [2, 6]:
     		import subprocess
     		try:
    -			process = subprocess.Popen(remote_cmd, shell=False, bufsize=0,
    +			process = subprocess.Popen(remote_cmd, shell=True, bufsize=0,
     								stdin=subprocess.PIPE, 
     								stdout=subprocess.PIPE)
     			(stdin, stdout) = (process.stdin, process.stdout)