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

Re: Git-p4 fails with NameError with python 2.7.2

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:06:55

Possibly related (same subject, not in this thread)

Luke Diamand [off-list ref] writes:
On 20 October 2015 at 11:34, Etienne Girard [off-list ref] wrote:
quoted
Hello,

Git-p4 fail when I try to rebase with the error: "NameError: global
name 'ctypes' is not defined". The error occurs when I use python
2.7.2 that is installed by default on my company's computers (it goes
without saying that everything works fine with python 2.7.10).

I'm a beginner in python, but simply importing ctypes at the beginning
of the script does the trick. I was wondering if submitting a patch
for this issue is worth the trouble, when a satisfying solution is not
using a 4 years old version of python.
If you're able to submit a patch that would be great!
Lars's 4d25dc44 (git-p4: check free space during streaming,
2015-09-26) introduced two references to ctypes.* and there is no
'import ctypes' anywhere in the script.

I do not follow Python development, but does the above mean that
with recent 2.x you can say ctypes without first saying "import
ctypes"?  It feels somewhat non-pythonesque that identifiers like
this is given to you without you asking with an explicit 'import',
so I am puzzled.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help