vuvova / gdb-tools

Various tools to improve the gdb experience
BSD 3-Clause "New" or "Revised" License
123 stars 17 forks source link

Support installation to system directories. Fix errors with python3. #5

Closed ildus closed 7 years ago

ildus commented 7 years ago

I've added a fix for sys.maxint

vuvova commented 7 years ago
  1. Can six be considered almost universally installed everywhere? I don't want to add a new dependency when a couple of lines (try/except) will do. I'd rather switch to six later, when I'll be really needed.
  2. Why would one use six.MAXSIZE at all, if sys.maxsize is present in both in python2 and python3?
  3. you've done a bunch of changes that I don't understand, moving imports around, replacing import help with import duel.help, and using os.path.join. Why is that?

I tried a minimal patch (see https://github.com/vuvova/gdb-tools/commit/4f850c83976c480c71a45b86b42a27841265abf9) and it looked like it was sufficient. I could install the package just fine and it worked after that. What am I missing?

ildus commented 7 years ago

1 and 2 depends on you. six is very common thing.

  1. I mostly changed imports because they don't work the way you specified them in python3. Look at: https://stackoverflow.com/questions/12172791/changes-in-import-statement-python3
ildus commented 7 years ago

After all when you publish this repository to PyPI (if you publish it), you can just add six to dependencies, it will be installed like normal dependency.

ildus commented 7 years ago

Forgot to explain os.path.join, pyc files will be in __pycache__ in python3. Also they can be turned off. You can't rely on pyc files to do something.

vuvova commented 7 years ago

imports - got it, thanks. PyPi - yes, I'll publish it. Thanks a lot for the help with it. os.path.join - I used rstrip meaning, to remove any of the characters 'p', 'y', 'c'. So it works both for .py and .pyc files, and (I've just tested) works with __pycache__ too.

vuvova commented 7 years ago

Fixed, pushed. Thanks!