Skip to content

Commit

Permalink
Some day I'll learn to listen to people
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Jun 22, 2013
1 parent cf667d2 commit ac3b3ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions topaz/objects/envobject.py
Expand Up @@ -37,14 +37,14 @@ def method_subscript(self, space, key):
def method_subscript_assign(self, space, key, w_value): def method_subscript_assign(self, space, key, w_value):
if "\0" in key: if "\0" in key:
raise space.error(space.w_ArgumentError, "bad environment variable name") raise space.error(space.w_ArgumentError, "bad environment variable name")
if "=" in key or key == "":
raise error_for_errno(space, errno.EINVAL)
if w_value is space.w_nil: if w_value is space.w_nil:
try: try:
del os.environ[key] del os.environ[key]
except KeyError: except (KeyError, OSError):
pass pass
return space.w_nil return space.w_nil
if "=" in key or key == "":
raise error_for_errno(space, errno.EINVAL)
value = Coerce.str(space, w_value) value = Coerce.str(space, w_value)
if "\0" in value: if "\0" in value:
raise space.error(space.w_ArgumentError, "bad environment variable value") raise space.error(space.w_ArgumentError, "bad environment variable value")
Expand Down

0 comments on commit ac3b3ff

Please sign in to comment.