-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop support for Python 2 in bodhi.server.
Python 2 support goes away upstream in two months, so it is time to embrace the glorious future. This change also drops support for pkgdb integration, since the pkgdb client library does not support Python 3. Mock imports were moved to be grouped with the stdlib imports as per PEP-8, since mock is part of the stdlib in Python 3. fixes #1970 fixes #2759 Signed-off-by: Randy Barlow <[email protected]>
- Loading branch information
1 parent
b662f73
commit c766843
Showing
124 changed files
with
308 additions
and
696 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2007-2018 Red Hat, Inc. and others. | ||
# | ||
# This file is part of Bodhi. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright © 2014-2018 Red Hat, Inc. | ||
# | ||
# This file is part of Bodhi. | ||
|
@@ -21,7 +20,6 @@ | |
# Authors: Ralph Bean <[email protected]> | ||
"""Define utilities and a view pertaining to captcha images for unauthenticated users.""" | ||
|
||
from __future__ import division | ||
import base64 | ||
import math | ||
import random | ||
|
@@ -31,7 +29,6 @@ | |
from pyramid.httpexceptions import HTTPGone, HTTPNotFound | ||
from pyramid.view import view_config | ||
import cryptography.fernet | ||
import six | ||
|
||
|
||
def math_generator(plainkey, settings): | ||
|
@@ -62,7 +59,7 @@ def math_generator(plainkey, settings): | |
|
||
x, y = int(tokens[0]), int(tokens[2]) | ||
|
||
value = six.text_type(x + y) | ||
value = str(x + y) | ||
return plainkey, value | ||
|
||
|
||
|
@@ -252,7 +249,7 @@ def decrypt(ciphertext, settings): | |
secret = settings['captcha.secret'] | ||
engine = cryptography.fernet.Fernet(secret) | ||
|
||
if isinstance(ciphertext, six.text_type): | ||
if isinstance(ciphertext, str): | ||
ciphertext = ciphertext.encode('utf-8') | ||
|
||
try: | ||
|
Oops, something went wrong.