diff --git a/setup.py b/setup.py index e54ab2b8..0edaf1f1 100644 --- a/setup.py +++ b/setup.py @@ -40,8 +40,8 @@ def get_version(): stdout=subprocess.PIPE, stderr=subprocess.PIPE) result = p.communicate()[0] if p.returncode == 0: - result = result.decode('ascii').strip()[1:] # strip spaces/newlines and initial v - if '-' in result: # not a tagged version + result = result.decode('ascii').strip()[1:] # strip spaces/newlines and initial v + if '-' in result: # not a tagged version real_number, commit_count, commit_hash = result.split('-', 2) version = '%s.post%s+%s' % (real_number, commit_count, commit_hash) else: @@ -72,6 +72,7 @@ class compile_translations(Command): pass def run(self): + orig_dir = os.getcwd() try: from django.core.management import call_command for path, dirs, files in os.walk('combo'): @@ -83,6 +84,7 @@ class compile_translations(Command): os.chdir(curdir) except ImportError: sys.stderr.write('!!! Please install Django >= 1.4 to build translations\n') + os.chdir(orig_dir) class compile_scss(Command):