haoxiang47 / ply

Automatically exported from code.google.com/p/ply
0 stars 0 forks source link

ply no longer python 2.3 compatible #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use lex and make sure the table file is written.

What is the expected output? What do you see instead?
Line 143 in lex.py: "basetabfilename = tabfile.rsplit(".",1)[-1]". In
python 2.3, the rsplit method doesn't exist. It is new in python 2.4.

What version of the product are you using? On what operating system?
I'm using 2.4 prerelease version on python 2.3.

Please provide any additional information below.
Maybe use a regular split, which reduces performance. Alternative, an
rfind() can be used.

Original issue reported on code.google.com by d.hendr...@tue.nl on 6 May 2008 at 8:20

GoogleCodeExporter commented 8 years ago
I created a fix...

Original comment by d.hendr...@tue.nl on 6 May 2008 at 8:29

Attachments:

GoogleCodeExporter commented 8 years ago
Fixed by just changing rsplit(".",1)[-1] to split(".")[-1].

Original comment by dbeaz...@gmail.com on 6 May 2008 at 10:57

GoogleCodeExporter commented 8 years ago
That's also a solution, although a slightly less efficient one, since it has to 
go
through the entire string...

Original comment by d.hendr...@tue.nl on 7 May 2008 at 6:19