Commit 03dcc73c authored by Amaury Forgeot d'Arc's avatar Amaury Forgeot d'Arc

Avoid invoking the parser/compiler just to test the presence of a function.

parent 6a098d20
...@@ -514,11 +514,7 @@ def getenv(key, default=None): ...@@ -514,11 +514,7 @@ def getenv(key, default=None):
__all__.append("getenv") __all__.append("getenv")
def _exists(name): def _exists(name):
try: return name in globals()
eval(name)
return True
except NameError:
return False
# Supply spawn*() (probably only for Unix) # Supply spawn*() (probably only for Unix)
if _exists("fork") and not _exists("spawnv") and _exists("execv"): if _exists("fork") and not _exists("spawnv") and _exists("execv"):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment