Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
Fixes #107 pip installing ptvsd fails on Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
zooba committed Feb 23, 2018
1 parent 81afa81 commit 54af7a5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import os
import os.path
import sys
from setuptools import setup, Extension

ROOT = os.path.dirname(os.path.abspath(__file__))
Expand All @@ -25,6 +26,18 @@ def get_pydevd_package_data():
for f in files:
yield os.path.join(root[len(ptvsd_prefix) + 1:], f)

cmdclass = {}

if sys.version_info[0] == 2:
from setuptools.command.build_ext import build_ext
class build_optional_ext(build_ext):
def build_extension(self, ext):
try:
super(build_optional_ext, self).build_extension(ext)
except:
pass
cmdclass = { 'build_ext': build_optional_ext }

setup(name='ptvsd',
version='4.0.0a1',
description='Visual Studio remote debugging server for Python',
Expand All @@ -43,4 +56,5 @@ def get_pydevd_package_data():
ext_modules=[Extension('ptvsd.pydevd._pydevd_bundle.pydevd_cython',
['ptvsd/pydevd/_pydevd_bundle/pydevd_cython.c'],
optional=True)],
cmdclass=cmdclass,
)

0 comments on commit 54af7a5

Please sign in to comment.