
import os
import sys

try:
    from oauthlib.oauth1 import rfc5849
    from oauthlib.common import extract_params
    from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)
except ImportError:
    path = os.path.abspath('/'.join(__file__.split('/')[:-1]+['packages']))
    sys.path.insert(0, path)
    from oauthlib.oauth1 import rfc5849
    from oauthlib.common import extract_params
    from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)

import os
import sys

try:
    from oauthlib.oauth1 import rfc5849
    from oauthlib.common import extract_params
    from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)
except ImportError:
    directory = os.path.dirname(__file__)
    path = os.path.join(directory, 'packages')
    sys.path.insert(0, path)
    from oauthlib.oauth1 import rfc5849
    from oauthlib.common import extract_params
    from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)

Make OAuth path hack platform independent.
Make OAuth path hack platform independent.

  
  import os
  import sys
  
  try:
      from oauthlib.oauth1 import rfc5849
      from oauthlib.common import extract_params
      from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)
  except ImportError:
-     path = os.path.abspath('/'.join(__file__.split('/')[:-1]+['packages']))
+     directory = os.path.dirname(__file__)
+     path = os.path.join(directory, 'packages')
      sys.path.insert(0, path)
      from oauthlib.oauth1 import rfc5849
      from oauthlib.common import extract_params
      from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)
+ 
Make OAuth path hack platform independent.
## Code Before:

import os
import sys

try:
    from oauthlib.oauth1 import rfc5849
    from oauthlib.common import extract_params
    from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)
except ImportError:
    path = os.path.abspath('/'.join(__file__.split('/')[:-1]+['packages']))
    sys.path.insert(0, path)
    from oauthlib.oauth1 import rfc5849
    from oauthlib.common import extract_params
    from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)
## Instruction:
Make OAuth path hack platform independent.
## Code After:

import os
import sys

try:
    from oauthlib.oauth1 import rfc5849
    from oauthlib.common import extract_params
    from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)
except ImportError:
    directory = os.path.dirname(__file__)
    path = os.path.join(directory, 'packages')
    sys.path.insert(0, path)
    from oauthlib.oauth1 import rfc5849
    from oauthlib.common import extract_params
    from oauthlib.oauth1.rfc5849 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)
