Now it is getting wacky was( Re: A modest Error (I mean Proposal))

Michael Hudson mwh21 at cam.ac.uk
Thu Jan 20 16:00:25 EST 2000


"Arinte" <shouldbe at message.com> writes:

> I change my code to look like this
> 
>  def IOCTL(self, command, dargs):
>   command1 = long(0)
>   if type(command)==type(2):
>    poss.write("IOCTL was int")
>    command1 = long(command)
>    poss.write("IOCTL Set to Long");
>   else:
>    if type(command) == type("  "):
>     poss.write("IOCTL was a string")
>     command1 = command
>    else:
>     if type(command)!=type(2L):
>      poss.write("IOCTL fail")
>      return -1
>   self.dump();
>   poss.IOCtl(self.devname,command1,dargs) #make this pass the ioctl command
> as an PossArg with a special name
>   print len("1234567")  #ADDED THIS LINE
>   return 0
> 
> Just to test len.  And now my program works???? If I remove this line or
> even just remove the print it doesn't work???
> Now what ??? If anything.  Another not here that critical print statement
> doesn't print the len of the string either...

Is it possible that you were importing an old pyc from somewhere? This
shouldn't happen, but it could explain what you were seeing
(particularly if the edits that took the py file away from what the
pyc said moved the lines around so the traceback didn't print the
right bits of the file).

Cheers,
M.



More information about the Python-list mailing list