made py 3 compatable
This commit is contained in:
		@ -1,6 +1,10 @@
 | 
				
			|||||||
import re
 | 
					import re
 | 
				
			||||||
import subprocess
 | 
					import subprocess
 | 
				
			||||||
from ConfigParser import ConfigParser
 | 
					try: 
 | 
				
			||||||
 | 
					    from configparser import ConfigParser
 | 
				
			||||||
 | 
					except ImportError:
 | 
				
			||||||
 | 
					    # Python < 3
 | 
				
			||||||
 | 
					    from ConfigParser import ConfigParser
 | 
				
			||||||
 | 
					
 | 
				
			||||||
version = "1.0.4"
 | 
					version = "1.0.4"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -29,7 +33,7 @@ class SemVer(object):
 | 
				
			|||||||
    def get_branches(self):
 | 
					    def get_branches(self):
 | 
				
			||||||
        p = subprocess.Popen(['git', 'log', '-1'], stdout=subprocess.PIPE,
 | 
					        p = subprocess.Popen(['git', 'log', '-1'], stdout=subprocess.PIPE,
 | 
				
			||||||
                             cwd='.')
 | 
					                             cwd='.')
 | 
				
			||||||
        message = p.stdout.read()
 | 
					        message = str(p.stdout.read())
 | 
				
			||||||
        matches = self.GET_COMMIT_MESSAGE.search(message)
 | 
					        matches = self.GET_COMMIT_MESSAGE.search(message)
 | 
				
			||||||
        if matches:
 | 
					        if matches:
 | 
				
			||||||
            self.merged_branch = matches.group(1)
 | 
					            self.merged_branch = matches.group(1)
 | 
				
			||||||
@ -104,7 +108,7 @@ def main():
 | 
				
			|||||||
    try:
 | 
					    try:
 | 
				
			||||||
        SemVer().run()
 | 
					        SemVer().run()
 | 
				
			||||||
    except Exception as e:
 | 
					    except Exception as e:
 | 
				
			||||||
        print(e.message)
 | 
					        print(e)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if __name__ == '__main__':
 | 
					if __name__ == '__main__':
 | 
				
			||||||
    try: main()
 | 
					    try: main()
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,8 @@
 | 
				
			|||||||
from ConfigParser import ConfigParser
 | 
					try:
 | 
				
			||||||
 | 
					    from configparser import ConfigParser
 | 
				
			||||||
 | 
					except ImportError:
 | 
				
			||||||
 | 
					    # Python < 3
 | 
				
			||||||
 | 
					    from ConfigParser import ConfigParser
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def get_version():
 | 
					def get_version():
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user