exaloop / codon

A high-performance, zero-overhead, extensible Python compiler using LLVM
https://docs.exaloop.io/codon
Other
14.81k stars 508 forks source link

`os.environ.setdefault` does not work #583

Open Real-Gecko opened 3 weeks ago

Real-Gecko commented 3 weeks ago

Creating test file

# test.py
import os

os.environ.setdefault("lala", "tralala")

Running with codon

$ codon run test.py
test.py:3:1-41: error: 'EnvMap' object has no attribute 'setdefault'
$ codon build -release -exe test.py
test.py:3:1-41: error: 'EnvMap' object has no attribute 'setdefault'
avitkauskas commented 3 weeks ago

Codon has very limited native os module implementation yet. I sent a PR to implement this particular functionality.

Meanwhile, you can use python module:

from python import os

os.environ.setdefault("lala", "tralala")