[kernel-tests] 70/73: Use input() instead of raw_input(). [PEP 3111]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is an automated email from the git hooks/post-receive script.

jforbes pushed a commit to branch master
in repository kernel-tests.

commit b7286674f06b9d75a0e745b10dd0637c54137cae
Author: Craig Rodrigues <rodrigc@xxxxxxxxxxx>
Date:   Sat Nov 14 17:05:31 2015 -0800

    Use input() instead of raw_input(). [PEP 3111]
    
    raw_input() was renamed to input() in Python 3, and raw_input() was removed.
    For Python 2, apply a workaround so that we still execute the raw_input()
    function, since it behaves differently from input().
    
    See:
        https://www.python.org/dev/peps/pep-3111/
---
 default/libhugetlbfs/libhugetlbfs/huge_page_setup_helper.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/default/libhugetlbfs/libhugetlbfs/huge_page_setup_helper.py b/default/libhugetlbfs/libhugetlbfs/huge_page_setup_helper.py
index 67ea91c..e41fbfc 100755
--- a/default/libhugetlbfs/libhugetlbfs/huge_page_setup_helper.py
+++ b/default/libhugetlbfs/libhugetlbfs/huge_page_setup_helper.py
@@ -95,12 +95,14 @@ print(" * Remaining System Memory..: %6d MB" % (memTotal - (hugePages * hugePage
 print(" * Huge Page User Group.....:  %s (%d)" % (hugeGIDName, hugeGID))
 print()
 
+if sys.version_info < (3,):
+    input = raw_input
 
 # ask how memory they want to allocate for huge pages
 userIn = None
 while not userIn:
     try:
-        userIn = raw_input("How much memory would you like to allocate for huge pages? "
+        userIn = input("How much memory would you like to allocate for huge pages? "
                            "(input in MB, unless postfixed with GB): ")
         if userIn[-2:] == "GB":
             userHugePageReqMB = int(userIn[0:-2]) * 1024
@@ -136,7 +138,7 @@ inputIsValid = False
 # ask for the name of the group allowed access to huge pages
 while inputIsValid == False:
     foundbad = False
-    userGroupReq = raw_input("What group should have access to the huge pages?"
+    userGroupReq = input("What group should have access to the huge pages?"
                              "(The group will be created, if need be) [hugepages]: ")
     if userGroupReq is '':
         userGroupReq = 'hugepages'
@@ -188,7 +190,7 @@ inputIsValid = False
 # ask for user(s) that should be in the huge page access group
 while inputIsValid == False:
     foundbad = False
-    userUsersReq = raw_input("What user(s) should have access to the huge pages (space-delimited list, users created as needed)? ")
+    userUsersReq = input("What user(s) should have access to the huge pages (space-delimited list, users created as needed)? ")
     for char in badchars:
         if char in userUsersReq:
             foundbad = True

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux