
from distutils.core import setup, Extension
import sys
import commands

setup (
    name = "kerberos",
    version = "1.0",
    description = "Kerberos high-level interface",
    ext_modules = [
        Extension(
            "kerberos",
            extra_link_args = commands.getoutput("krb5-config --libs gssapi").split(),
            extra_compile_args = commands.getoutput("krb5-config --cflags gssapi").split(),
            sources = [
                "src/kerberos.c",
                "src/kerberosbasic.c",
                "src/kerberosgss.c",
                "src/base64.c"
            ],
        ),
    ],
)


from distutils.core import setup, Extension
import sys

if sys.version_info < (3,0):
    import commands as subprocess
else:
    import subprocess

setup (
    name = "kerberos",
    version = "1.0",
    description = "Kerberos high-level interface",
    ext_modules = [
        Extension(
            "kerberos",
            extra_link_args = subprocess.getoutput("krb5-config --libs gssapi").split(),
            extra_compile_args = subprocess.getoutput("krb5-config --cflags gssapi").split(),
            sources = [
                "src/kerberos.c",
                "src/kerberosbasic.c",
                "src/kerberosgss.c",
                "src/base64.c"
            ],
        ),
    ],
)

Build for either python 2 or python 3
Build for either python 2 or python 3

  
  from distutils.core import setup, Extension
  import sys
- import commands
+ 
+ if sys.version_info < (3,0):
+     import commands as subprocess
+ else:
+     import subprocess
  
  setup (
      name = "kerberos",
      version = "1.0",
      description = "Kerberos high-level interface",
      ext_modules = [
          Extension(
              "kerberos",
-             extra_link_args = commands.getoutput("krb5-config --libs gssapi").split(),
+             extra_link_args = subprocess.getoutput("krb5-config --libs gssapi").split(),
-             extra_compile_args = commands.getoutput("krb5-config --cflags gssapi").split(),
+             extra_compile_args = subprocess.getoutput("krb5-config --cflags gssapi").split(),
              sources = [
                  "src/kerberos.c",
                  "src/kerberosbasic.c",
                  "src/kerberosgss.c",
                  "src/base64.c"
              ],
          ),
      ],
  )
  
Build for either python 2 or python 3
## Code Before:

from distutils.core import setup, Extension
import sys
import commands

setup (
    name = "kerberos",
    version = "1.0",
    description = "Kerberos high-level interface",
    ext_modules = [
        Extension(
            "kerberos",
            extra_link_args = commands.getoutput("krb5-config --libs gssapi").split(),
            extra_compile_args = commands.getoutput("krb5-config --cflags gssapi").split(),
            sources = [
                "src/kerberos.c",
                "src/kerberosbasic.c",
                "src/kerberosgss.c",
                "src/base64.c"
            ],
        ),
    ],
)

## Instruction:
Build for either python 2 or python 3
## Code After:

from distutils.core import setup, Extension
import sys

if sys.version_info < (3,0):
    import commands as subprocess
else:
    import subprocess

setup (
    name = "kerberos",
    version = "1.0",
    description = "Kerberos high-level interface",
    ext_modules = [
        Extension(
            "kerberos",
            extra_link_args = subprocess.getoutput("krb5-config --libs gssapi").split(),
            extra_compile_args = subprocess.getoutput("krb5-config --cflags gssapi").split(),
            sources = [
                "src/kerberos.c",
                "src/kerberosbasic.c",
                "src/kerberosgss.c",
                "src/base64.c"
            ],
        ),
    ],
)
