Merge lp://qastaging/~cjwatson/command-not-found/python3 into lp://qastaging/~command-not-found-developers/command-not-found/trunk

Proposed by Colin Watson
Status: Merged
Merged at revision: 153
Proposed branch: lp://qastaging/~cjwatson/command-not-found/python3
Merge into: lp://qastaging/~command-not-found-developers/command-not-found/trunk
Diff against target: 753 lines (+213/-165)
10 files modified
CommandNotFound/CommandNotFound.py (+58/-41)
CommandNotFound/__init__.py (+3/-1)
CommandNotFound/util.py (+17/-11)
UnifiedDataExtractor/DebPackage.py (+21/-19)
UnifiedDataExtractor/create-binary-database (+23/-18)
UnifiedDataExtractor/diff-scan-data (+25/-20)
UnifiedDataExtractor/scan (+32/-26)
UnifiedDataExtractor/verify_scan_data.py (+24/-21)
bash_command_not_found (+1/-1)
command-not-found (+9/-7)
To merge this branch: bzr merge lp://qastaging/~cjwatson/command-not-found/python3
Reviewer Review Type Date Requested Status
Zygmunt Krynicki Approve
Review via email: mp+110092@code.qastaging.launchpad.net

Description of the change

Port to Python 3. This should all still run under Python 2 as well.

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

47 + if key is not bytes:

I think you meant isinstance() here

74 - (PACKAGE, BASENAME_PATH) = range(2)
75 + (PACKAGE, BASENAME_PATH) = list(range(2))

299 - (SOFT, HARD) = range(2)
300 + (SOFT, HARD) = list(range(2))

(and some more), those changes seem unneeded, am I missing something?

Otherwise, wow, lots of old code that brings back memories, great work in porting that to python3! :)

review: Needs Fixing
174. By Colin Watson

Fix "key is not bytes" thinko.

Revision history for this message
Barry Warsaw (barry) wrote :

@Zigmunt: re: line 47 yep, I caught that one too, and Colin fixed it in the update.

Re the wrapping of list(range(2)) etc. I think you're right:

Python 3.2.3 (default, May 3 2012, 15:51:42)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> (soft, hard) = range(2)
>>> soft
0
>>> hard
1

Revision history for this message
Colin Watson (cjwatson) wrote :

list(range(...)): That was indeed my misunderstanding from blindly believing 2to3. I tested it yesterday for something else and realised that was redundant. I've reverted those changes; please re-review?

175. By Colin Watson

Revert unnecessary list(range(...)) wrapping.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Looks perfect now, thanks!

review: Approve
Revision history for this message
Colin Watson (cjwatson) wrote :

Great, thanks! Perhaps you could land this? I can help with rolling a
new Ubuntu package if you like, but I don't have commit access to
lp:command-not-found.

Revision history for this message
Michael Vogt (mvo) wrote :

On Wed, Jun 13, 2012 at 11:40:40PM -0000, Colin Watson wrote:
> Great, thanks! Perhaps you could land this? I can help with rolling a
> new Ubuntu package if you like, but I don't have commit access to
> lp:command-not-found.

I landed this in lp:command-not-found now, thanks for the branch!

Cheers,
 Michael

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches