frozenpandaman / s3s

Successor to splatnet2statink. Takes battle data from the SplatNet 3 app and uploads it to stat.ink!
https://github.com/frozenpandaman/s3s/wiki
GNU General Public License v3.0
394 stars 72 forks source link

Stop circular import in iksm.py #172

Closed rinsuki closed 6 months ago

rinsuki commented 6 months ago

starting from https://github.com/frozenpandaman/s3s/commit/a4785322a8ac9ba23224b7010eaf519e0b1e96e7, s3s contains a circular import.

which causes s3s no longer able to import from another module (like my s3splus):

Traceback (most recent call last):
  File "/Users/user/work/github.com/rinsuki/s3splus/main.py", line 13, in <module>
    from plus.utils import PLUS_VERSION
  File "/Users/user/work/github.com/rinsuki/s3splus/plus/utils.py", line 9, in <module>
    from s3sproxy import A_VERSION
  File "/Users/user/work/github.com/rinsuki/s3splus/s3sproxy.py", line 6, in <module>
    from s3s import A_VERSION
  File "/Users/user/work/github.com/rinsuki/s3splus/s3s/s3s.py", line 12, in <module>
    import iksm, utils
  File "/Users/user/work/github.com/rinsuki/s3splus/s3s/iksm.py", line 8, in <module>
    from s3s import F_GEN_URL as f_gen_url
ImportError: cannot import name 'F_GEN_URL' from partially initialized module 's3s' (most likely due to a circular import) (/Users/user/work/github.com/rinsuki/s3splus/s3s/s3s.py)

so I fixed it.

Note

I'm actually not using the f API way, so could you try it with two pass (run with/without session_token) before merge it...?

frozenpandaman commented 6 months ago

Thanks! Glad you found a way to fix it and I appreciate you catching this! (Introduced in the PR #159)

imink f API still seems to work.