#332 remove has_key (not working in python3)
Merged by mikem. Opened by tkopecek.
tkopecek/koji has_key  into  master

Download 332.patch

Another python3 required translation

inverted logic

I found one place where the logic got broken (see code comment). I don't see any similar cases, but maybe worth more checking.

Was this done with python-modernize?

I have your branch rebased (several conflicts with the exception changes) and the fix applied here, btw:

https://github.com/mikem23/koji-playground/tree/has_key

Running 2to3 --fix has_key gives almost the same code.
Cosmetic differences:

  • 2to3 leaves out some unnecessary parens (but I think it's more readable with them)
-    if ('anon_handle_' + cmd) in globals():
+    if 'anon_handle_' + cmd in globals():
  • 2to3 doesn't touch commented code

  • 2to3 wraps lines longer than 80 when it changes them

  • 2to3 doesn't handle code in cheetah templates

  • 2to3 adds an explicit (and unnecessary) bool cast here

-        params['locked'] = 'locked' in form
+        params['locked'] = bool('locked' in form)

If you're happy with my rebase + fix, I can just merge that

yep, go for it

Commit a8711956 fixes this pull-request

Pull-Request has been merged by mikem@redhat.com

Metadata