← Back to team overview

testtools-dev team mailing list archive

Re: [Merge] lp:~jseutter/testtools/py3_again into lp:testtools

 

FWIW, I think this is a reasonable workaround for when bzrlib isn't available.  At least it's no worse than just returning None unconditionally.


=== modified file 'setup.py'
--- setup.py	2012-05-12 05:21:17 +0000
+++ setup.py	2012-05-16 17:49:49 +0000
@@ -13,6 +13,11 @@
         import bzrlib.errors
         import bzrlib.workingtree
     except ImportError:
+        from subprocess import Popen, PIPE
+        proc = Popen(['bzr', 'revno'], stdout=PIPE)
+        stdout, stderr = proc.communicate()
+        if proc.returncode == 0:
+            return int(stdout.strip())
         return None
     try:
         t = bzrlib.workingtree.WorkingTree.open_containing(__file__)[0]

-- 
https://code.launchpad.net/~jseutter/testtools/py3_again/+merge/105569
Your team testtools developers is subscribed to branch lp:testtools.


References