Fix build error with scons-4.4.0 version which is based on python3
[platform/upstream/iotivity.git] / extlibs / raxmpp / SConscript
index 6db32f5..72caa2b 100644 (file)
@@ -23,7 +23,7 @@
 #
 ######################################################################
 import os
-import commands
+import subprocess
 
 Import('env')
 
@@ -35,26 +35,26 @@ with_ra_ibb = env.get('WITH_RA_IBB')
 if with_ra and not with_ra_ibb :
        # check 'raxmppl' library, if it doesn't exits, ask user to download it
        if not os.path.exists('raxmpp'):
-               print '''
+               print('''
        *********************************** Error: ***********************************************
        * Please download ra_xmpp as following :
        *     $ git clone https://gerrit.iotivity.org/gerrit/iotivity-xmpp extlibs/raxmpp/raxmpp
        ******************************************************************************************
-       '''
+       ''')
                Exit(1)
 
-       print 'building with ra_xmpp'
+       print('building with ra_xmpp')
        if env.get('RELEASE'):
-               print src_dir
+               print(src_dir)
                build_dir = os.path.join(src_dir, 'extlibs/raxmpp/raxmpp/out', target_os, target_arch, 'release/')
        else:
                build_dir = os.path.join(src_dir, 'extlibs/raxmpp/raxmpp/out/', target_os, target_arch, 'debug/')
        os.chdir('raxmpp')
        sconsflags = ' RELEASE=true' if  env['RELEASE'] else ' RELEASE=false'
-       foo=commands.getoutput('scons external' + sconsflags )
-       print foo
-       foo=commands.getoutput('scons' + sconsflags )
-       print foo
+       foo=subprocess.getoutput('scons external' + sconsflags )
+       print(foo)
+       foo=subprocess.getoutput('scons' + sconsflags )
+       print(foo)
 
        env.AppendUnique(CPPPATH = src_dir+'/extlibs/raxmpp/raxmpp/ra_xmpp/',
                                LIBPATH=build_dir,