erg-lang / erg

A statically typed language compatible with Python
http://erg-lang.org
Apache License 2.0
2.68k stars 55 forks source link

Parallel eval all result in the same processing #370

Closed toddlerer closed 1 year ago

toddlerer commented 1 year ago

Describe the bug?

erg -c "print! 1" & erg -c "print! 2"

the result is

1
1

As a workaround, the problem is resolved by adding a hash value to the dumped pyc filename.

Reproducible code

No response

Expected result

No response

Actual result

No response

Additional context

No response

Erg version

Erg 0.6.3

Python version

Python3.11

OS

macOS 12 (Monterey)

mtshiba commented 1 year ago

In case of -c option, the name of the dumped pyc file will be stdin.pyc. Since the hash value of the same string will still be the same, it is necessary to add a random suffix to the filename.