Small update
[PyMotherless.git] / pyverinfo.py
blob8bbb1ac51e98b906571f9cc9ed8e8effdd619472
1 #!/usr/bin/python2
3 import re
4 import os
5 import sys
6 import json
7 import subprocess
9 pyexecpath = os.path.realpath(sys.executable)
10 pkgsetuppy = os.path.realpath("."+os.path.sep+"setup.py")
11 pypkgenlistp = subprocess.Popen(
12 [pyexecpath, pkgsetuppy, "getversioninfo"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
13 pypkgenout, pypkgenerr = pypkgenlistp.communicate()
14 if(sys.version[0] == "3"):
15 pypkgenout = pypkgenout.decode('utf-8')
16 pyconfiginfo = json.loads(pypkgenout)
17 print(pypkgenout)