Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3 migration get __builtin__ from six #25920

Merged
merged 1 commit into from Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions FWCore/ParameterSet/python/Types.py
Expand Up @@ -5,6 +5,7 @@
import copy
import math
import six
from six.moves import builtins

class _Untracked(object):
"""Class type for 'untracked' to allow nice syntax"""
Expand Down Expand Up @@ -127,7 +128,6 @@ def _pythonValue(value):



import __builtin__
class bool(_SimpleParameterTypeBase):
@staticmethod
def _isValid(value):
Expand All @@ -140,7 +140,7 @@ def _valueFromString(value):
if value.lower() in ('false','f','off','no', '0'):
return bool(False)
try:
return bool(__builtin__.bool(eval(value)))
return bool(builtins.bool(eval(value)))
except:
pass
raise RuntimeError('can not make bool from string '+value)
Expand Down
11 changes: 6 additions & 5 deletions HLTrigger/Configuration/test/add/tracingImport.py
Expand Up @@ -8,7 +8,8 @@
in the order in which they are defined
"""

import sys, imp, __builtin__
import sys, imp,
from six import builtins
import re

# patterns to discover cms.Path and cms.EndPath definitions in imported files
Expand Down Expand Up @@ -145,9 +146,9 @@ def reload_hook(module):


# Save the original hooks
original_import = __builtin__.__import__
original_reload = __builtin__.reload
original_import = builtins.__import__
original_reload = builtins.reload

# Now install our hooks
__builtin__.__import__ = import_hook
__builtin__.reload = reload_hook
builtins.__import__ = import_hook
builtins.reload = reload_hook
4 changes: 2 additions & 2 deletions PhysicsTools/PythonAnalysis/python/cmscompleter.py
Expand Up @@ -11,7 +11,7 @@

import readline
import rlcompleter
import __builtin__
from six import builtins
import __main__

__all__ = ["CMSCompleter"]
Expand Down Expand Up @@ -49,7 +49,7 @@ def global_matches(self, text):
matches = []
n = len(text)
for list in [keyword.kwlist,
__builtin__.__dict__,
builtins.__dict__,
self.cmsnamespace]:
for word in list:
if word[:n] == text and word != "__builtins__":
Expand Down