Thread (31 messages) flat view 31 messages, 8 authors, 2016-06-15

Re: [PATCH 1/5] t/t5800: skip if python version is older than 2.5

From: Brandon Casey <hidden>
Date: 2016-06-15 22:48:54
Subsystem: the rest · Maintainer: Linus Torvalds

On 06/02/2010 09:44 AM, Brandon Casey wrote:
On 06/02/2010 01:21 AM, Sverre Rabbelier wrote:
quoted
Heya,

On Wed, Jun 2, 2010 at 02:13, Brandon Casey [off-list ref] wrote:
quoted
This test script depends on the git-remote-testgit python script.  This
python script makes use of the hashlib module which was released in python
version 2.5.  So, add a new pre-requisite named PYTHON_2_5_OR_NEWER to
test-lib.sh and check for it in t5800.
Perhaps instead we can change git-remote-testgit to do:

"try:
import hashlib
except ImportError:
import ?? as hashlib
"
I can only guess at what that does. :)
Correction, I have no idea what that does.

Here's the patch:
diff --git a/git-remote-testgit.py b/git-remote-testgit.py
index 9253922..1371497 100644
--- a/git-remote-testgit.py
+++ b/git-remote-testgit.py
@@ -1,6 +1,9 @@
 #!/usr/bin/env python
 
-import hashlib
+try:
+    import hashlib
+except ImportError:
+    import ?? as hashlib
 import sys
 import os
 sys.path.insert(0, os.getenv("GITPYTHONLIB","."))


I get:

  File "<snip>/git-remote-testgit", line 6
    import ?? as hashlib
           ^
SyntaxError: invalid syntax
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help